The Bourne shell is a historical implementation of /bin/sh

learn more… | top users | synonyms

0
votes
0answers
19 views

How to check if a shell is interactive or not for Bourne shell [duplicate]

How can I test with a command/condition if I am in an interactive (ran by user) or a batch (ran by a cron job) Bourne shell (not Bash)?
4
votes
1answer
844 views

Variable scope in while-read-loop on Solaris

Could someone please explain to me why my while loop seems to have an internal scope? I've seen multiple explanations online but they all have to do with pipes. My code has none. The code: ...
8
votes
2answers
3k views

Array in unix Bourne Shell

I am trying to implement array in Bourne shell (/bin/sh). I found that way to initialize array elements is: arr=(1 2 3) But it is encountering an error: syntax error at line 8: `arr=' unexpected ...
2
votes
0answers
51 views

What privileges do I have (find out within bourne shell script) [closed]

I am hacking away on a remote helper for git. The script is in bourne shell. I wanted to create some temporary directory in the home dir. For some reason I get permission denied. From my shell ...
15
votes
2answers
489 views

Use of ^ as a shell metacharacter

I wrote a small script today which contained grep -q ^local0 /etc/syslog.conf During review, a coworker suggested that ^local0 be quoted because ^ means "pipe" in the Bourne shell. Surprised by ...
4
votes
1answer
181 views

IFS null is not the same as unset IFS?

I read a great question on here called Understanding IFS. I was surprised because the answers and comments quote POSIX which states that IFS= is not the same as unsetting IFS. If you unset IFS, ...
5
votes
2answers
3k views

bourne shell if [ -e $directory/file.$suffix ]

I've been looking inclusive I even checked the if manual for bash and tried in cli mode. #!/bin/sh CONFIG_DIR="/var/opt/SUNWldm/" read option if [ $option -eq 9 ]; then ret=1 elif [ -e ...