On Sat, Mar 23, 2013 at 3:15 AM, Linda A. Walsh <l...@tlinx.org> wrote: > In reading some suse startup code (*shiver*), > > I came across this construct > > > > func() { > local comm ## command from /proc/$pid/stat > > for comm; do > test -s comm || continue > ppid = pidofproc $comm > parents="${parents:+parents:}${ppid}" > done > } > ------------------- > Is that valid code? does for have some arcane usage > to test if the contents of it exists as a file or something?
`for comm;d'o is like: `for comm in "$@";do' The 2 lines after that are definitely wrong though and should probably look like test -s $comm || continue ppid=$(pidofproc $comm) (without trying to guess what the purpose of this function)