Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.misc > #17028

Re: bash script problem ?

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>

Show all headers | View raw


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 | NextPrevious in thread | Find similar | Unroll thread


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