summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2018-11-01 19:19:38 +0100
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2018-11-01 19:19:38 +0100
commitdd5c7ca837f39119e718dc3ca6918ea6fec70f61 (patch)
tree319489c3c6b0fb59628661c66e3258676fa6ee8e
parente3f24f6437d928df13517c8c6ff010204d2f65f9 (diff)
downloadhemiptera-master.zip
hemiptera-master.tar.gz
hemiptera-master.tar.bz2
echo > /dev/stderr is evilHEADmaster
It is not really portable, use >&2 instead, which is the right way to do it.
-rwxr-xr-xcreateproject.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/createproject.sh b/createproject.sh
index 8bc4193..87ec315 100755
--- a/createproject.sh
+++ b/createproject.sh
@@ -2,29 +2,29 @@
### Tool to create projects manually.
-[ -d projects ] || { echo "projects/ dir not found. Please enter the hemiptera base directory." >/dev/stderr; exit 1; }
+[ -d projects ] || { echo "projects/ dir not found. Please enter the hemiptera base directory." >&2; exit 1; }
-[ -z "$1" ] && { echo "Usage: $0 PRNAME">/dev/stderr; exit 1; }
+[ -z "$1" ] && { echo "Usage: $0 PRNAME">&2; exit 1; }
-[ -d "projects/$1" ] && { echo "project $1 already exists. Not creating" >/dev/stderr; exit 1; }
+[ -d "projects/$1" ] && { echo "project $1 already exists. Not creating" >&2; exit 1; }
mkdir "projects/$1"
while true; do
read -p "Enter name of developer, leave blank to end list > " dev
case $dev in
- '') echo "Dev list written." > /dev/stderr; break;;
+ '') echo "Dev list written." >&2; break;;
* ) echo "$dev" >> "projects/$1/devs.txt" ;;
esac
done
-echo "Please enter a description, enter a blank line to end description:" > /dev/stderr
+echo "Please enter a description, enter a blank line to end description:" >&2
while true; do
read -p "> " line
case $line in
- '') echo "Description written." > /dev/stderr; break;;
+ '') echo "Description written." >&2; break;;
* ) echo "$line" >> "projects/$1/description.txt" ;;
esac
done
-echo "Project created." > /dev/stderr
+echo "Project created." >&2