The tag has no wiki summary.

learn more… | top users | synonyms

13
votes
2answers
386 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
66 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, ...
3
votes
2answers
288 views

Exiting out of an infinite reboot loop in startup (rc.local)

I am creating a startup script (called from rc.local) in Debian Squeeze. The startup script checks for a variable value from a file, decrements the variable and writes it back to the file, then if the ...
3
votes
2answers
5k views

Difference between 2>&-, 2>/dev/null, |&, &>/dev/null and >/dev/null 2>&1

Just looking for the difference between 2>&- 2>/dev/null |& &>/dev/null >/dev/null 2>&1 and their portability with non-Bourne shells like tcsh, mksh, etc.
5
votes
2answers
1k 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 ...