scripting, no-op statements in bash function (was: SATA hot swap)

Michael ODonnell michael.odonnell at comcast.net
Wed Jun 10 11:33:06 EDT 2009



I had a look at /sbin/rescan-scsi-bus.sh - it's not the most elegant
bash script I've seen but it apparently works - cool.  I've known about
the add-single-device trick but it's clunky and there have been times in
the past where it was easier to just reboot to get the kernel to notice
a new device...

One thing I noticed was that some of the functions in that script are
constructed thus:

    funcName ()
    {
      : funcName
      otherStuffHere
    }

...and I wonder if those no-op constructions have some value, maybe
during development or debugging, maybe forcing the function name into
a parameter list?



More information about the gnhlug-discuss mailing list