NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
eton
May 18, 2015Luminary
RAIDiator 4.1.14 changed bash shell behaviour - Bug?
RAIDiator version 4.1.14 changed bash's shell behaviour. Bug or new features?
Example of executing bulkGetter script as user UserName under RAIDiator version 4.1.13 (Sparc):
After updating to 4.1.14 I am not able to run scripts/programs as a different user than root.
Executing the bash script above under 4.1.14, outputs the message: "sh: line 1: bulkGetter.sh: command not found".
And I've tried with different syntaxes for su, but still no luck. Yes, the path works and I can run the script as root. And the script is stored in /root/bin and moving it to /usr/local/bin didn't change anything.
Example of executing bulkGetter script as user UserName under RAIDiator version 4.1.13 (Sparc):
# su -c "bulkGetter.sh downloadlist.txt . -rm" -s /bin/sh UserName
After updating to 4.1.14 I am not able to run scripts/programs as a different user than root.
4. Updated bash to fix "ShellShock" vulnerability.
5. Fixed additional bash vulnerabilities.
Executing the bash script above under 4.1.14, outputs the message: "sh: line 1: bulkGetter.sh: command not found".
And I've tried with different syntaxes for su, but still no luck. Yes, the path works and I can run the script as root. And the script is stored in /root/bin and moving it to /usr/local/bin didn't change anything.
12 Replies
Replies have been turned off for this discussion
- SkywalkerNETGEAR ExpertSince originally you seemed to really want your script in /usr/local/bin, and you want /usr/local/bin to the in $PATH, why don't you just add /usr/local/bin to the default system path. To avoid an ambiguity, here's a simple command to accomplish that:
sed -i '/^ENV_PATH/s#$#:/usr/local/bin#' /etc/login.defs - etonLuminary
Skywalker wrote: Since originally you seemed to really want your script in /usr/local/bin, and you want /usr/local/bin to the in $PATH, why don't you just add /usr/local/bin to the default system path. To avoid an ambiguity, here's a simple command to accomplish that:
sed -i '/^ENV_PATH/s#$#:/usr/local/bin#' /etc/login.defs
Thanks @Skywalker
Could you please explain how the sed inplace string /^ENV_PATH/s#$#:/usr/local/bin# works? Tried to google it, a bit complex.
And "sed -i.bak" would be more safe. :)
Related Content
NETGEAR Academy
Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!