[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Option "-n" not working reliably and poorly documented
From: |
Ronny Standtke |
Subject: |
Option "-n" not working reliably and poorly documented |
Date: |
Wed, 11 Feb 2009 15:52:43 +0100 |
Hi
The "-n" option not seem to work. Example with a little stupid nonsense
script:
-----------
ronny@ronny-desktop:/tmp$ cat test.sh
#!/bin/sh
if [ $blah == "test"]
then
echo "teste mich!"
fi
ronny@ronny-desktop:/tmp$ sh -n test.sh
ronny@ronny-desktop:/tmp$ sh test.sh
[: 5: missing ]
ronny@ronny-desktop:/tmp$
-----------
The missing whitespace was my most frequent error when I started writing
shell scripts because I come from whitespace agnostic programming
languages.
Another strange thing: The man page of bash does only implicitly mention
the "-n" option in the description of the "-D" option: "This implies the
-n option; no commands will be executed."
All in all it looks like the "-n" option is poorly documented and
implementation is incomplete.
Regards
Ronny Standtke
--
Ronny Standtke Fachhochschule Nordwestschweiz
Dozent MedienpƤdagogik / ICT PƤdagogische Hochschule
Telefon: +41 32 627 92 47 Obere Sternengasse 7
Mobil : +41 79 786 81 82 4502 Solothurn
- Option "-n" not working reliably and poorly documented,
Ronny Standtke <=