bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

unfamiliar construct...


From: Linda A. Walsh
Subject: unfamiliar construct...
Date: Fri, 22 Mar 2013 18:15:13 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.24) Gecko/20100228 Lightning/0.9 Thunderbird/2.0.0.24 Mnenhy/0.7.6.666

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?

----
Ended up finding that while chasing down a bunch of
lines in the completion.d dir
like


[ $USERLAND = GNU -o $UNAME = Darwin \
  -o $UNAME = FreeBSD -o $UNAME = SunOS -o $UNAME = Cygwin \
  -o $UNAME = OpenBSD ] &&
man()
}
.....
Which don't work well when some var they expect to be defined,
isn't.  Tried telling them to either use [[]] or use quotes, but so far
have been ignored....so having to fix them manually so I don't gets lots of
bogus errors on login and any user-switch (sudo/su)...









reply via email to

[Prev in Thread] Current Thread [Next in Thread]