Re: Display cmd within shell

2018-06-16 Thread Cameron Simpson
On 16Jun2018 10:24, Marek Howard wrote: On Tue, 2018-06-12 at 07:52 +1000, Cameron Simpson wrote: Personally I like "set -x". I've even got a tiny line script called "set-x" which goes: #!/bin/sh set -x exec "$@" and many scripts which do variants on: trace= [ -t 2 ] && trace=set-x

Re: Display cmd within shell

2018-06-16 Thread Marek Howard
On Tue, 2018-06-12 at 07:52 +1000, Cameron Simpson wrote: > Personally I like "set -x". I've even got a tiny line script called "set-x" > which goes: > > #!/bin/sh > set -x > exec "$@" > > and many scripts which do variants on: > > trace= > [ -t 2 ] && trace=set-x # at least during

Re: Display cmd within shell

2018-06-11 Thread Bev in TX
> On Jun 11, 2018, at 4:50 PM, Gordon Messmer wrote: > > On 06/11/2018 02:31 PM, Bev in TX wrote: >> >> It’s an option of the builtin set command. >> >> set … >> … When options are specified, they set or unset shell attributes. …. >> -v Print shell input lines as they are read. > >

Re: Display cmd within shell

2018-06-11 Thread Cameron Simpson
On 11Jun2018 14:02, Gordon Messmer wrote: On 06/11/2018 05:40 AM, bruce wrote: #-- this doesn't quite work.. as it generates the complete "ls... output" but it does display the cmd and the resulting num of the ls files.. (set -x; ls -al /cloud_nfs_parse/austincc*__parse.dat | wc -l ) Bash doe

Re: Display cmd within shell

2018-06-11 Thread Gordon Messmer
On 06/11/2018 02:31 PM, Bev in TX wrote: It’s an option of the builtin set command. set … … When options are specified, they set or unset shell attributes. …. -v Print shell input lines as they are read. Yeah, that also *kinda* works.  That'll print lines as they're read, not as the

Re: Display cmd within shell

2018-06-11 Thread Bev in TX
> On Jun 11, 2018, at 4:02 PM, Gordon Messmer wrote: > > On 06/11/2018 05:40 AM, bruce wrote: >> #-- this doesn't quite work.. as it generates the complete "ls... >> output" but it does display the cmd and the resulting num of the ls >> files.. >> (set -x; ls -al /cloud_nfs_parse/austincc*__par

Re: Display cmd within shell

2018-06-11 Thread Gordon Messmer
On 06/11/2018 05:40 AM, bruce wrote: #-- this doesn't quite work.. as it generates the complete "ls... output" but it does display the cmd and the resulting num of the ls files.. (set -x; ls -al /cloud_nfs_parse/austincc*__parse.dat | wc -l ) Bash doesn't have a mode in which it echos a command

Re: Display cmd within shell

2018-06-11 Thread George N. White III
On Mon, 11 Jun 2018 at 09:41, bruce wrote: > Hi. > > Running a centos/fed box, and trying to craft a simple shell test to > run a bunch of commands where the command is displayed as well as the > output > > Ie. The following cmd might return 10 (the num of the files if the cmd > is run from the c

Re: Display cmd within shell

2018-06-11 Thread Matthew Miller
On Mon, Jun 11, 2018 at 08:40:59AM -0400, bruce wrote: > Running a centos/fed box, and trying to craft a simple shell test to > run a bunch of commands where the command is displayed as well as the > output > > Ie. The following cmd might return 10 (the num of the files if the cmd > is run from th

Re: Display cmd within shell

2018-06-11 Thread Patrick O'Callaghan
On Mon, 2018-06-11 at 08:40 -0400, bruce wrote: > Hi. > > Running a centos/fed box, and trying to craft a simple shell test to > run a bunch of commands where the command is displayed as well as the > output > > Ie. The following cmd might return 10 (the num of the files if the cmd > is run from

Re: Display cmd within shell

2018-06-11 Thread Bev in TX
> On Jun 11, 2018, at 7:40 AM, bruce wrote: > > Hi. > > Running a centos/fed box, and trying to craft a simple shell test to > run a bunch of commands where the command is displayed as well as the > output > > Ie. The following cmd might return 10 (the num of the files if the cmd > is run fro

Display cmd within shell

2018-06-11 Thread bruce
Hi. Running a centos/fed box, and trying to craft a simple shell test to run a bunch of commands where the command is displayed as well as the output Ie. The following cmd might return 10 (the num of the files if the cmd is run from the cmdline. ls -al /cloud_nfs_parse/austincc*__parse.dat | wc