Greetings list :-)
Oh dear, I've forgotten what the bash cli is to see the output of a command line input (it dumps result to screen). Pretty much the same bash functionality as Ctrl-R gives one a rolling history of entered commands.
Coul someone please remind me :-)
TiA, and have a great day!
Stu@
On Tue, 2007-08-21 at 21:15 +0200, Stuart Murray-Smith wrote:
Greetings list :-)
Oh dear, I've forgotten what the bash cli is to see the output of a command line input (it dumps result to screen). Pretty much the same bash functionality as Ctrl-R gives one a rolling history of entered commands.
Coul someone please remind me :-)
---- question not clear...default of cli commands in bash shell would output standard out and error out to screen so this should be the default behavior.
Oh dear, I've forgotten what the bash cli is to see the output of a command line input (it dumps result to screen). Pretty much the same bash functionality as Ctrl-R gives one a rolling history of entered commands.
Could someone please remind me :-)
question not clear...default of cli commands in bash shell would output standard out and error out to screen so this should be the default behavior.
Thanks Craig :-)
Yes, it's difficult to describe, and that's prolly why I've struggled to Google it. If one completed a bash script with 'exit 0' and all ran well, nothing (or null) is sent to stdout. If a script passes a variable on to another executable, this is may not necessarily be sent to stdout, but there is something one can pass at cli time that does copy this/these var(s) to stdout to see what same script produces.
I hope this makes sense :-)
TiA,
Stu@
Stuart Murray-Smith wrote:
Yes, it's difficult to describe, and that's prolly why I've struggled to Google it. If one completed a bash script with 'exit 0' and all ran well, nothing (or null) is sent to stdout. If a script passes a variable on to another executable, this is may not necessarily be sent to stdout, but there is something one can pass at cli time that does copy this/these var(s) to stdout to see what same script produces.
Put "set -x" near the top of the script or run it via sh -x. As in:
sh -x /some/script/that/you/want/to/debug
Is that the sort of thing you're after?
On 8/21/07, Stuart Murray-Smith eight32@gmail.com wrote:
Oh dear, I've forgotten what the bash cli is to see the output of a command line input (it dumps result to screen). Pretty much the same bash functionality as Ctrl-R gives one a rolling history of entered commands.
Could someone please remind me :-)
question not clear...default of cli commands in bash shell would output standard out and error out to screen so this should be the default behavior.
Thanks Craig :-)
Yes, it's difficult to describe, and that's prolly why I've struggled to Google it. If one completed a bash script with 'exit 0' and all ran well, nothing (or null) is sent to stdout. If a script passes a variable on to another executable, this is may not necessarily be sent to stdout, but there is something one can pass at cli time that does copy this/these var(s) to stdout to see what same script produces.
I hope this makes sense :-)
Are you looking for "$?" (Dollar sign followed by ?). in bash this holds the last exist status.
/yonas
Oh dear, I've forgotten what the bash cli is to see the output of a command line input (it dumps result to screen). Pretty much the same bash functionality as Ctrl-R gives one a rolling history of entered commands.
Could someone please remind me :-)
question not clear...default of cli commands in bash shell would output standard out and error out to screen so this should be the default behavior.
Thanks Craig :-)
Yes, it's difficult to describe, and that's prolly why I've struggled to Google it. If one completed a bash script with 'exit 0' and all ran well, nothing (or null) is sent to stdout. If a script passes a variable on to another executable, this is may not necessarily be sent to stdout, but there is something one can pass at cli time that does copy this/these var(s) to stdout to see what same script produces.
I hope this makes sense :-)
Are you looking for "$?" (Dollar sign followed by ?). in bash this holds the last exist status
Thanks Yonas, Todd
It's not in the script itself, but a keystroke sequence that one does at the command prompt... same as Ctrl-R gets one a rolling history stack :-)
TiA,
Stu@
On 8/21/07, Stuart Murray-Smith eight32@gmail.com wrote:
Oh dear, I've forgotten what the bash cli is to see the output of a command line input (it dumps result to screen). Pretty much the same bash functionality as Ctrl-R gives one a rolling history of entered commands.
Could someone please remind me :-)
question not clear...default of cli commands in bash shell would output standard out and error out to screen so this should be the default behavior.
Thanks Craig :-)
Yes, it's difficult to describe, and that's prolly why I've struggled to Google it. If one completed a bash script with 'exit 0' and all ran well, nothing (or null) is sent to stdout. If a script passes a variable on to another executable, this is may not necessarily be sent to stdout, but there is something one can pass at cli time that does copy this/these var(s) to stdout to see what same script produces.
I hope this makes sense :-)
Are you looking for "$?" (Dollar sign followed by ?). in bash this holds the last exist status
Thanks Yonas, Todd
It's not in the script itself, but a keystroke sequence that one does at the command prompt... same as Ctrl-R gets one a rolling history stack :-)
so here you are assuming that the shell keeps a history of exit status?
/yonas
It's not in the script itself, but a keystroke sequence that one does at the command prompt... same as Ctrl-R gets one a rolling history stack :-)
so here you are assuming that the shell keeps a history of exit status?
Not necessarily, the rolling history stack and exit status was an example :-)
If I had to enter:
# pidof mysqld
say, and this cli returned null, there is something that I can do to pipe the actual return to stdout, even if it's default is to return null to monitor (stdout).
HTH with the description :-)
Stuart Murray-Smith wrote:
It's not in the script itself, but a keystroke sequence that one does at the command prompt... same as Ctrl-R gets one a rolling history stack :-)
so here you are assuming that the shell keeps a history of exit status?
Not necessarily, the rolling history stack and exit status was an example :-)
If I had to enter:
# pidof mysqld
say, and this cli returned null, there is something that I can do to pipe the actual return to stdout, even if it's default is to return null to monitor (stdout).
HTH with the description :-)
that sounds a lot like echo $?...as in
# pidof mysqld;echo $?
It's not in the script itself, but a keystroke sequence that one does at the command prompt... same as Ctrl-R gets one a rolling history stack :-)
so here you are assuming that the shell keeps a history of exit status?
Not necessarily, the rolling history stack and exit status was an example :-)
If I had to enter:
# pidof mysqld
say, and this cli returned null, there is something that I can do to pipe the actual return to stdout, even if it's default is to return null to monitor (stdout).
HTH with the description :-)
that sounds a lot like echo $?...as in
# pidof mysqld;echo $?
Yes, something like that. Similar to I/O redirection i>&j but invoked by keystroke sequence and not actually typing characters to the command line.
TiA :-)
Craig White wrote:
On Tue, 2007-08-21 at 21:15 +0200, Stuart Murray-Smith wrote:
Greetings list :-)
Oh dear, I've forgotten what the bash cli is to see the output of a command line input (it dumps result to screen). Pretty much the same bash functionality as Ctrl-R gives one a rolling history of entered commands.
Coul someone please remind me :-)
question not clear...default of cli commands in bash shell would output standard out and error out to screen so this should be the default behavior.
It sounds to me like Stuart is looking for the history command.
Oh dear, I've forgotten what the bash cli is to see the output of a command line input (it dumps result to screen). Pretty much the same bash functionality as Ctrl-R gives one a rolling history of entered commands.
Coul someone please remind me :-)
question not clear...default of cli commands in bash shell would output standard out and error out to screen so this should be the default behavior.
It sounds to me like Stuart is looking for the history command.
Unfortunately not :-) I saw this bash cli explained in an email to fedora-list about 18 months ago, and now I've forgotten it. It's a keystroke sequence like Ctrl-R to get a rolling history stack.
Could it be:
trap {args}
TiA
Stu@
Stuart Murray-Smith wrote:
Greetings list :-)
Oh dear, I've forgotten what the bash cli is to see the output of a command line input (it dumps result to screen). Pretty much the same bash functionality as Ctrl-R gives one a rolling history of entered commands.
Coul someone please remind me :-)
TiA, and have a great day!
Stu@
Are you thinking of Shift+PageUp & Shift+PageDown buttons to scroll through large output displays
On Tue, 2007-08-21 at 13:34 -0700, Don Russell wrote:
Stuart Murray-Smith wrote:
Greetings list :-)
Oh dear, I've forgotten what the bash cli is to see the output of a command line input (it dumps result to screen). Pretty much the same bash functionality as Ctrl-R gives one a rolling history of entered commands.
Coul someone please remind me :-)
TiA, and have a great day!
Stu@
Are you thinking of Shift+PageUp & Shift+PageDown buttons to scroll through large output displays
Humble apologies for getting just slightly off-topic, but try <Ctrl><Shift>T and see what happens. Maybe every else on the list knew this, but I didn't! I just started playing around with key combinations to see what happened.
As to getting the out of a command to stdout (the screen), all I can think of is just "bash -v <your command>."
-- Mark C. Allman, PMP -- Allman Professional Consulting, Inc. -- 617-947-4263 -- www.allmanpc.com
BusinessMsg -- the secure, managed, J2EE/AJAX Enterprise IM/IC solution.
Oh dear, I've forgotten what the bash cli is to see the output of a command line input (it dumps result to screen). Pretty much the same bash functionality as Ctrl-R gives one a rolling history of entered commands.
Coul someone please remind me :-)
TiA, and have a great day!
Stu@
Are you thinking of Shift+PageUp & Shift+PageDown buttons to scroll through large output displays
Thanks Don. Yes, similar to Shift{PageUp|PageDown} which are keystroke sequences in themselves to manipulate command line view, what I have in mind brings any background processes/output to the command line. I've manned bash and perused 'trap' and the 'bg|fg|&' functionality, and it's similar to that.
Thanks so far guys :-)
Stu@
On Tue, 2007-08-21 at 21:15 +0200, Stuart Murray-Smith wrote:
Oh dear, I've forgotten what the bash cli is to see the output of a command line input (it dumps result to screen). Pretty much the same bash functionality as Ctrl-R gives one a rolling history of entered commands.
You don't mean just using the cursor up and down arrows to step through what was last command line typed, one command line at a time?
e.g. If the last three command lines I'd typed had been "cd /tmp" then "ls" then "touch something", cursoring up would show those command lines again, one at a time, at the current prompt, and I could press enter to re-issue that command (or edit it, first),
Oh dear, I've forgotten what the bash cli is to see the output of a command line input (it dumps result to screen). Pretty much the same bash functionality as Ctrl-R gives one a rolling history of entered commands.
You don't mean just using the cursor up and down arrows to step through what was last command line typed, one command line at a time?
e.g. If the last three command lines I'd typed had been "cd /tmp" then "ls" then "touch something", cursoring up would show those command lines again, one at a time, at the current prompt, and I could press enter to re-issue that command (or edit it, first)
Thanks Tim, but I think I should steer away from the history stack example and emphasise that it's more a forking output to the foreground (stdout) thing.
As I described earlier, if I had to enter:
# pidof mysqld
say, and this cli returned null, there is something that I can do to pipe the actual return to stdout, even if it's default is to return null to monitor (stdout).
HTH with the description :-)
Stu@
As I described earlier, if I had to enter:
# pidof mysqld
say, and this cli returned null, there is something that I can do to pipe the actual return to stdout, even if it's default is to return null to monitor (stdout).
I think this is where most are confused with your question. What do you mean to pipe the "actual return" to stdout? A blank line is piped to stdout (echo "line 1";pidof mysqld;echo "line 2" will yield line 1, blank line, then line 2 which will really be line 3 of the output) hence where the confusion lies as to what you mean by the "actual return". Maybe if you described the bigger picture of what you are trying to do (vs just that one single line) it would be easier for us to determine what may help you accomplish that.
At 8:57 AM +0200 8/22/07, Stuart Murray-Smith wrote:
Oh dear, I've forgotten what the bash cli is to see the output of a command line input (it dumps result to screen). Pretty much the same bash functionality as Ctrl-R gives one a rolling history of entered commands.
You don't mean just using the cursor up and down arrows to step through what was last command line typed, one command line at a time?
e.g. If the last three command lines I'd typed had been "cd /tmp" then "ls" then "touch something", cursoring up would show those command lines again, one at a time, at the current prompt, and I could press enter to re-issue that command (or edit it, first)
Thanks Tim, but I think I should steer away from the history stack example and emphasise that it's more a forking output to the foreground (stdout) thing.
As I described earlier, if I had to enter:
# pidof mysqld
say, and this cli returned null, there is something that I can do to pipe the actual return to stdout, even if it's default is to return null to monitor (stdout).
HTH with the description :-)
First, what you call a "cli" appears to be a command.
Second, the pidof command prints all the pids associated with a process name on a single output line. If pidof finds the named process, the line will have one or more space-separated numbers on it. If it doesn't find the named process, it will print an empty line. It does not "return null".
-----Original Message-----
As I described earlier, if I had to enter:
# pidof mysqld
Second, the pidof command prints all the pids associated with a process name on a single output line. If pidof finds the named process, the line will have one or more space-separated numbers on it. If it doesn't find the named process, it will print an empty line. It does not "return null". -----------------------------
To add to what Tony said... `pidof` will return an exit code of 1 if no processes exist, and 0 if processes do exist:
# pidof Xorg 2354 # echo $? 0 # pidof mysql
# echo $? 1
On Wed, 22 Aug 2007 08:57:21 +0200 "Stuart Murray-Smith" eight32@gmail.com wrote:
Oh dear, I've forgotten what the bash cli is to see the output of a command line input (it dumps result to screen). Pretty much the same bash functionality as Ctrl-R gives one a rolling history of entered commands.
You don't mean just using the cursor up and down arrows to step through what was last command line typed, one command line at a time?
e.g. If the last three command lines I'd typed had been "cd /tmp" then "ls" then "touch something", cursoring up would show those command lines again, one at a time, at the current prompt, and I could press enter to re-issue that command (or edit it, first)
Thanks Tim, but I think I should steer away from the history stack example and emphasise that it's more a forking output to the foreground (stdout) thing.
As I described earlier, if I had to enter:
# pidof mysqld
say, and this cli returned null, there is something that I can do to pipe the actual return to stdout, even if it's default is to return null to monitor (stdout).
HTH with the description :-)
Stu@
man tee ?
Henk