Hi all,
Just got this book on shell scripting and thought I'd give it a go.
Here's my script:
My problem is with the "-n" option in the second echo command... if I run echo in the command prompt the "-n" option works as advertised, but in the script, -n is interpreted as the string "-n" and not as an option. I'm guessing it's a syntax issue... any suggestions?
-Mike
Just got this book on shell scripting and thought I'd give it a go.
Here's my script:
Code:
#! /bin/sh
# titleterm - tells Terminal to change its title to the specified value
if [ $# != 1 ]; then
echo "Usage: $0 title" >&2
exit 1
else
echo -n "\033]0;$1\007"
fi
exit 0
My problem is with the "-n" option in the second echo command... if I run echo in the command prompt the "-n" option works as advertised, but in the script, -n is interpreted as the string "-n" and not as an option. I'm guessing it's a syntax issue... any suggestions?
-Mike