Syntax And Usages


Table of Contents

One line commands syntax 
spread one line command to multi-lines 
Consecutive conditions 
Synopsis 
Analysis 
Syntaxs 
:case 
:loop 
cmd:sh: { list;} 
Usage 
Help 
Trying History 
sh:function 
function definition 
sh script function return value 
From faq 
Check if standard input is a terminal 
How do I "include" one shell script from within another shell script? 
What "dot" files do the various shells use? 
cmd:eval 
Multi commands 
$cmd vs. eval "$cmd" 
advanced heredoc usage 
advanced heredoc usage 
set, then command? 
pass swithes along to subroutines 
pass swithes along to subroutines 
pass swithes along to subroutines 
Is there any way to nest backticks? 
Is there any way to nest backticks? 
Is there any way to nest backticks? 
Is there any way to nest backticks? 
Nest backticks examples 
How can I specify two commands for xargs 
need bash help 
EOF in unix 
EOF in unix 
reading files in bash 
split with /bin/sh 
split with /bin/sh 
split with /bin/sh 
split with /bin/sh 
How to set IFS variable in bash 
How to set IFS variable in bash 
NO-BREAK SPACE 
translate-able shell scripts 
lynx return 
set, export, env & subshell (was: export) 
set, export, env & subshell (was: export) 
set, export, env & subshell (was: export) 
eliminate the column headings 
for(int i=0; i<10; i++) type of loop in bash 
for(int i=0; i<10; i++) type of loop in bash 
concat 2 files to 1 

One line commands syntax 

*Tags*: cmd:if, cmd:while

if [ x"$@" = x"" ] ; then cmtc='-nc' ; elif ...; then ...; else cmtc='-c'; fi
if diff -wu f1 f2 > $tf.diff 2>&1; then echo a; else echo b; fi
for ii in `jot $n`; do
for attr in 0 1 4 5 7 ; do
while [ "${DIRSTACK[1]}" ] ; do popd +1 > /dev/null 2>&1 ; done
while expr `netstat -a | grep ":www" | wc -l` '>' $ipm ; do :; done
while :; do ...
while read line; do
        echo postinstall: $line
done
[Note]

no ";" after 'then' & 'do'!

spread one line command to multi-lines 

/usr/bin/cal |
  # bold today
  sed -e "s/^/ /; s/$/ /; s/ $4 /$bold $4 $unbold/"

— Look, can even put comments between pipe command!

documented on: 02-06-99