Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.linux.misc > #17028
| From | dave.gma+news002@googlemail.com.invalid (Dave Sines) |
|---|---|
| Newsgroups | comp.os.linux.misc |
| Subject | Re: bash script problem ? |
| Date | 2016-03-17 00:20 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <kr9prcxre3.ln2@perseus.wenlock-data.co.uk> (permalink) |
| References | <ncc2v7$gbt$1@dont-email.me> |
no.top.post@gmail.com wrote:
> In article <>, dave.gma+news002@googlemail.com.invalid (Dave Sines) wrote:
> That's quite amazing!
> Path1=`dirname \`head -n 1 /root/.mc/filepos | awk '{ print $1 }'\``
> Path2=`dirname \`head -n 2 /root/.mc/filepos |awk '{print $1}' | tail -n 1\``
> echo "A=" $Path1 $Path2
>
> Path1=$( dirname -- $( head -n 1 /root/.mc/filepos | awk '{ print $1 }' ) )
> Path2=$( dirname -- $( head -n 2 /root/.mc/filepos | awk '{ print $1 }' | tail -n 1 ) )
> echo "B=" $Path1 $Path2
>
> { read Path1 x ; read Path2 x ; } < /root/.mc/filepos
> Path1=$(dirname -- "$Path1")
> Path2=$(dirname -- "$Path2")
> echo "C=" $Path1 $Path2
>
> { read Path1 junk ; read Path2 junk ; } < /root/.mc/filepos
> echo "xterm-e mc" "$(dirname -- "$Path1")" "$(dirname -- "$Path2")"
> # xterm -e mc "$(dirname -- "$Path1")" "$(dirname -- "$Path2")"
>
> !! your COMPLETELY new syntax is un-nerving.
> Where is it documented?
In the ash (and dash) manual page. $( ... ) is under Command Substitution
and { ... ; } is under Grouping Commands Together.
The bash man page documents the two under Command Substitution and
Compound Commands respectively.
Back to comp.os.linux.misc | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: bash script problem ? no.top.post@gmail.com - 2016-03-16 16:51 +0000 Re: bash script problem ? dave.gma+news002@googlemail.com.invalid (Dave Sines) - 2016-03-17 00:20 +0000
csiph-web