Ask a Question related to FreeBSD, Design and Development.
-
Christopher Kelley #1
script "echo on" like MS-DOS?
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.
Thanks,
Christopher Kelley
Christopher Kelley Guest
-
#39195 [Opn->Bgs]: if (0=="any sting") echo "it's return true";
ID: 39195 Updated by: derick@php.net Reported By: waynewn at citiz dot net -Status: Open +Status: ... -
#39195 [NEW]: if (0=="any sting") echo "it's return true";
From: waynewn at citiz dot net Operating system: win/freebsd PHP version: 5.1.6 PHP Bug Type: Scripting Engine problem Bug... -
"Devel::DProf" on a PERL script uses "Test::More"
Dear all, I encountered a problem while run profiling on a script which uses "Test::More". May I ask whether anybody have some idea or wrap... -
#26162 [NEW]: $a="0abcdefg";if ($a==0) echo "OK"; result is "OK" ?!
From: zhuminglun at yahoo dot com dot cn Operating system: linux/win2000 PHP version: 4.3.4 PHP Bug Type: *General Issues... -
#26162 [Opn->Bgs]: $a="0abcdefg";if ($a==0) echo "OK"; result is "OK" ?!
ID: 26162 Updated by: didou@php.net Reported By: zhuminglun at yahoo dot com dot cn -Status: Open +Status: ... -
Erik Trulsson #2
Re: script "echo on" like MS-DOS?
On Tue, Feb 22, 2005 at 11:32:17PM -0800, Christopher Kelley wrote:
The answer to that depends entirely on which shell is being used, as it> 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.
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]ertr1013@student.uu.se[/email]
Erik Trulsson Guest
-
Matt Navarre #3
Re: script "echo on" like MS-DOS?
On Tuesday 22 February 2005 11:32 pm, Christopher Kelley wrote:
on the first line have #! /bin/sh -x> Is there a simple way to cause a shell script to echo to the terminal
> similar to the old MS-DOS "echo on" command?
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
>
> _______________________________________________
> [email]freebsd-questions@freebsd.org[/email] mailing list
> [url]http://lists.freebsd.org/mailman/listinfo/freebsd-questions[/url]
> To unsubscribe, send any mail to
> "freebsd-questions-unsubscribe@freebsd.org"Matt Navarre Guest
-
Giorgos Keramidas #4
Re: script "echo on" like MS-DOS?
On 2005-02-22 23:32, Christopher Kelley <bsd@kelleycows.com> wrote:
You can do similar things with the set -x option of sh(1):> Is there a simple way to cause a shell script to echo to the terminal
> similar to the old MS-DOS "echo on" command?
% 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.
Giorgos Keramidas Guest
-
Christopher Kelley #5
Re: script "echo on" like MS-DOS?
Giorgos Keramidas wrote:
Thanks. Yes, I'm using sh, I forgot to mention that. That's exactly>On 2005-02-22 23:32, Christopher Kelley <bsd@kelleycows.com> 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):
>
>
what I was looking for!
Christopher
Christopher Kelley Guest



Reply With Quote

