Top "Sh" questions

sh is the standard Unix shell since Version 7 Unix.

Forward function declarations in a Bash or a Shell script?

Is there such a thing in bash or at least something similar (work-around) like forward declarations, well known in C / …

bash function sh forward-declaration
Using mkdir -m -p and chown together correctly

I would like to create a directory using a bash script and then set the mode to 00755 at the same …

linux bash sh mkdir
What exactly is sudo bang bang?

What is the purpose of sudo bang bang (sudo !!) and when might one need to use it?

linux bash terminal sh
Automatically Restart PHP Script on Exit

Is there a way I can automatically restart a PHP script whenever it exits, regardless of whether it has been …

php bash cron sh restart
shell script to spawn processes, terminate children on SIGTERM

I want to write a shell script that spawns several long-running processes in the background, then hangs around. Upon receiving …

bash scripting sh long-running-processes sigterm
How do I get the effect and usefulness of "set -e" inside a shell function?

set -e (or a script starting with #!/bin/sh -e) is extremely useful to automatically bomb out if there is …

shell error-handling sh
How can I switch to the user jenkins in the middle of a ssh script?

I run ssh root@myhost "sh -x" < myremotecommands.sh where myremotecommands.sh contains: #!/bin/sh sudo su apt-get update …

ssh sudo sh su
Is it necessary to specify traps other than EXIT?

I see a lot of shell scripts that do: trap cmd 0 1 2 3 13 15 # EXIT HUP INT QUIT PIPE TERM In every shell …

bash shell ksh zsh sh
How to check if stdin is from the terminal or a pipe in a shell script?

I am writing a POSIX shell script that may or may not receive input from stdin as in foo.sh &…

posix sh
DBMS_CRYPTO package is missing

I am using Oracle Database 11g Enterprise Edition Release 11.2.00.40 - 64bit Production. We have a initial admin user which will …

oracle plsql oracle11g sh dbms-crypto