Top "Sh" questions

sh is the standard Unix shell since Version 7 Unix.

TERM environment variable not set

I have a file.sh with this, when run show : TERM environment variable not set. smbmount //172.16.44.9/APPS/Interfas/HERRAM/sc5 /…

linux sh
Using variables inside a bash heredoc

I'm trying to interpolate variables inside of a bash heredoc: var=$1 sudo tee "/path/to/outfile" > /dev/null <&…

bash variables sh heredoc
Shell script current directory?

What is current directory of shell script? I this current directory from which I called it? Or this directory where …

linux directory sh working-directory
Shell Script: How to write a string to file and to stdout on console?

How to write a string to file and to stdout on console? If I do echo "hello" > logfile.txt …

bash shell command-line sh ksh
Calculate modulo in sh script

I am working on an sh script in which I am in a WHILE loop where a variable gets incremented …

sh modulo
Cron jobs and random times, within given hours

I need the ability to run a PHP script 20 times a day at completely random times. I also want it …

bash cron sh
Dockerfile CMD instruction will exit the container just after running it

I want to setup some configuration when my container starts, for this I am using shell scripts. But my container …

bash shell docker sh dockerfile
Inline if shell script

Is it possible to execute shell script in command line like this : counter=`ps -ef | grep -c "myApplication"`; if [ $counter …

linux shell scripting sh
How to solve "bad interpreter: No such file or directory"

I'm trying to run a sh script and get the following error on Mac: /usr/bin/perl^M: bad interpreter: …

macos perl sh
How can I tell if a file is older than 30 minutes from /bin/sh?

How do I write a script to determine if a file is older than 30 minutes in /bin/sh? Unfortunately does …

linux unix sh