| OS X - Development and Darwin Discussion and questions about development for Mac OS X. |
| Post Reply | New Thread | Subscribe |
|
|
Thread Tools |
![]() Member Since: Mar 20, 2009
Posts: 2
![]() |
Hi all,
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 -Mike |
| QUOTE Thanks | |
![]() Member Since: Mar 15, 2007
Posts: 161
![]() Mac Specs: 17" MacBook Pro, 2.33GHz C2D, 2GB RAM
|
From the man page for echo(1):
"Some shells may provide a built-in echo command which is similar or identical to this utility. Most notably, the built-in echo in sh(1) does NOT accept the -n option. Consult the builtin(1) manual page." You can get the -n option to work if you change to using /bin/bash as the shell rather than /bin/sh (in the first line of your script), or else if you invoke /bin/echo via its explicit path to avoid using the built-in version while continuing to use the standard Bourne shell. |
| QUOTE Thanks | |
| Post Reply | New Thread | Subscribe |
| Thread Tools | |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|
|||||||
Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| Noob Question!! Beware! | Dj_Noob | OS X - Operating System | 2 | 10-21-2008 11:33 PM |
| Snow Leopard Noob Question | borjasanz | OS X - Operating System | 5 | 10-14-2008 12:50 PM |
| noob question (sorry!) | skypirate | Apple Notebooks | 2 | 07-31-2007 12:33 AM |
| Noob OS question | Joe Blood | Switcher Hangout | 1 | 01-23-2006 12:54 PM |
| Shell script question | Niwrad | OS X - Development and Darwin | 14 | 06-28-2005 04:58 PM |
All times are GMT -4. The time now is 01:56 AM.
Powered by vBulletin