From suse@tlinx.org Thu Jan 24 08:43:38 2013 From: Linda Walsh To: users@lists.opensuse.org Subject: [opensuse] system scripts using BASHism's but invoked as "#!/bin/sh" Date: Thu, 24 Jan 2013 00:42:51 -0800 Message-ID: <5100F40B.8050909@tlinx.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3396778804498983649==" --===============3396778804498983649== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit I'm constantly seeing system scripts starting with #!/bin/sh which tells BASH to run in POSIX conformance mode, yet occasionally, more or less randomly, I'll see "BASHism's" in the script. Case in point: the cron job for logrotate references the Array PIPESTATUS to get at the exit value of log rotate. Arrays and PIPESTATUS never used to be part of POSIX. Also a quick grep turns up startup scripts, using Bash's '[[' syntax, such as: boot.localfs boot.kdump dhcpd dhcpd6 kbd dictd cifs monit mysql named zfs-fuse Shouldn't these scripts be invoked as #!/bin/bash? Maybe some of them run because they are invoked as bash -c