tech-userlevel archive

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

Re: rc.d/rndctl

On Thu, Sep 18, 2008 at 07:57:03PM +0200, Joerg Sonnenberger wrote:
  | I'd suggest to just handle /etc/ifconfig.ifX and ifconfig_ifX identical,
  | basically doing:
  | if [ -n "$ifconfig_ifX" ]; then
  |     echo $ifconfig_ifX
  | else
  |     cat /etc/ifconfig_ifX
  | fi | while read arg; do
  |     ...
  | done

As an aside, you have to be careful with
        | while read foo; do
in sh(1) because the code in `...' may or may not be executed
in a subshell depending upon the shell's implementation,
and therefore can't modify the state (including variables)
of the current shell.

This is one of those "shell programming gotchas" you
need to be aware of :)


Attachment: pgprChp6M58AX.pgp
Description: PGP signature

Home | Main Index | Thread Index | Old Index