Re: script echo on like MS-DOS?
Giorgos Keramidas wrote: On 2005-02-22 23:32, Christopher Kelley [EMAIL PROTECTED] wrote: Is there a simple way to cause a shell script to echo to the terminal similar to the old MS-DOS echo on command? You can do similar things with the set -x option of sh(1): Thanks. Yes, I'm using sh, I forgot to mention that. That's exactly what I was looking for! Christopher ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: script echo on like MS-DOS?
On Tue, Feb 22, 2005 at 11:32:17PM -0800, Christopher Kelley wrote: Is there a simple way to cause a shell script to echo to the terminal similar to the old MS-DOS echo on command? I've tried to read the fine man pages, and even tried looking at for instance the make scripts that seem to echo their commands to the terminal, but I couldn't even being to follow them. The answer to that depends entirely on which shell is being used, as it is the shell itself that will have to do the echoing. One solution that seems to work for all of /bin/sh, bash, and zsh is to invoke the shell with the -x flag. Then the shell will echo each command before executing it. For other shells there may, or may not be an equivalent. -- Insert your favourite quote here. Erik Trulsson [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: script echo on like MS-DOS?
On Tuesday 22 February 2005 11:32 pm, Christopher Kelley wrote: Is there a simple way to cause a shell script to echo to the terminal similar to the old MS-DOS echo on command? on the first line have #! /bin/sh -x or type /bin/sh -x script -x also does the same thing for csh scripts. This might not be what you want, but it's the closest thing I can think of to echo on I've tried to read the fine man pages, and even tried looking at for instance the make scripts that seem to echo their commands to the terminal, but I couldn't even being to follow them. Thanks, Christopher Kelley ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: script echo on like MS-DOS?
On 2005-02-22 23:32, Christopher Kelley [EMAIL PROTECTED] wrote: Is there a simple way to cause a shell script to echo to the terminal similar to the old MS-DOS echo on command? You can do similar things with the set -x option of sh(1): % gothmog:/tmp$ cat echo.sh % #!/bin/sh % % set -x % ls /tmp % set +x % echo no echo % ls /tmp % gothmog:/tmp$ sh echo.sh % + ls /tmp % echo.sh screens ssh-6OYAaVIB9P % + set +x % no echo % echo.sh screens ssh-6OYAaVIB9P % gothmog:/tmp$ Note how the commands after set -x are echoed. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]