Re: a good way to save a keystroke?
At 09:11 PM 11/21/2003, Kevin D. Kinsey, DaleCo, S.P. wrote: Which shell are you using? C shell. Maybe I should switch to Bash? I mostly ssh in using my user acct and then have at least one screen session where I su to root. However to the extent that I'd like to write shell scripts that are consistent for account that may use different shells, if that even makes sense, than maybe backticks are the way to go. Marty Landman Face 2 Interface Inc 845-679-9387 Sign On Required: Web membership software for your site Make a Website: http://face2interface.com/Home/Demo.shtml ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: a good way to save a keystroke?
On Sat, 22 Nov 2003 09:44:30 -0500 Marty Landman [EMAIL PROTECTED] granted us these pearls of wisdom: At 09:11 PM 11/21/2003, Kevin D. Kinsey, DaleCo, S.P. wrote: Which shell are you using? C shell. Maybe I should switch to Bash? I mostly ssh in using my user acct and then have at least one screen session where I su to root. However to the extent that I'd like to write shell scripts that are consistent for account that may use different shells, if that even makes sense, than maybe backticks are the way to go. Just as an aside to this particular thread. I am sure I read somewhere that it is usually best to write scripts for sh , ie /bin/sh as many of the others are located in /usr/something which when the file system is not stable may or may not be accessible. man sh would be your friend here and quite often shell scripts that are run from cron are written with this shell in mind. good luck LukeK ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: a good way to save a keystroke?
At 10:39 AM 11/22/2003, Scott W wrote: I know there are some people that refuse to use anything other than csh/tcsh, but when it comes down to writing shell scripts going out to customers, or part of any software, you write for sh.or if Linux only, for bash. Why can't we all just get along? 8^] Marty Landman Face 2 Interface Inc 845-679-9387 Sign On Required: Web membership software for your site Make a Website: http://face2interface.com/Home/Demo.shtml ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
a good way to save a keystroke?
I wanted to look at a file and figured why not pipe the output of which to more, which of course didn't work so I figured if I backticked the which output with more in front that would work, and apparently it does (though I'm not sure that the cmd itself wasn't executed?). e.g. more `which apachectl` Is this a reasonable way to get what I'm after, or a bad thing? Marty Landman Face 2 Interface Inc 845-679-9387 Sign On Required: Web membership software for your site Make a Website: http://face2interface.com/Home/Demo.shtml ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: a good way to save a keystroke?
On Friday, Nov 21, 2003, at 16:44 Europe/London, Marty Landman wrote: I wanted to look at a file and figured why not pipe the output of which to more, which of course didn't work so I figured if I backticked the which output with more in front that would work, and apparently it does (though I'm not sure that the cmd itself wasn't executed?). e.g. more `which apachectl` Is this a reasonable way to get what I'm after, or a bad thing? more filename cat filename | more Should work Jake ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: a good way to save a keystroke?
On Fri, Nov 21, 2003 at 11:44:22AM -0500, Marty Landman wrote: I wanted to look at a file and figured why not pipe the output of which to more, which of course didn't work so I figured if I backticked the which output with more in front that would work, and apparently it does (though I'm not sure that the cmd itself wasn't executed?). e.g. more `which apachectl` Is this a reasonable way to get what I'm after, or a bad thing? That's fine. The command that gets executed is which, not apachectl, so there's no need to worry on that account. Ceri -- pgp0.pgp Description: PGP signature
Re: a good way to save a keystroke?
Marty Landman wrote: I wanted to look at a file and figured why not pipe the output of which to more, which of course didn't work so I figured if I backticked the which output with more in front that would work, and apparently it does (though I'm not sure that the cmd itself wasn't executed?). e.g. more `which apachectl` Is this a reasonable way to get what I'm after, or a bad thing? It's fine, although anything inside the ticks does in fact get executed, eg which apachectl expands to /usr/local/bin/apachectl (not running apache, don't remember the freebsd location offhand but you get the point) so then the literal text '/usr/local/bin/apachectl' replaces the command inside the ticks to become: more /usr/local/bin/apachectl So yep, it's doing what you want, the way you wanted to...use something similar fairly often myself, although note that the 'current' standard for executing commands is now $(cmd), eg more $(which apachectl) Scott ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: a good way to save a keystroke?
At 08:40 PM 11/21/2003, Scott W wrote: So yep, it's doing what you want, the way you wanted to...use something similar fairly often myself, although note that the 'current' standard for executing commands is now $(cmd), eg more $(which apachectl) I get FreeB more $(which apachectl) Illegal variable name. FreeB Maybe I should've mentioned I'm on 4.8, or is there another reason? Marty Landman Face 2 Interface Inc 845-679-9387 Sign On Required: Web membership software for your site Make a Website: http://face2interface.com/Home/Demo.shtml ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: a good way to save a keystroke?
Marty Landman wrote: At 08:40 PM 11/21/2003, Scott W wrote: So yep, it's doing what you want, the way you wanted to...use something similar fairly often myself, although note that the 'current' standard for executing commands is now $(cmd), eg more $(which apachectl) I get FreeB more $(which apachectl) Illegal variable name. FreeB Maybe I should've mentioned I'm on 4.8, or is there another reason? Marty Landman Face 2 Interface Inc 845-679-9387 Sign On Required: Web membership software for your site Make a Website: http://face2interface.com/Home/Demo.shtml D'oh, my mistake- you're using csh I take it? Sorry, I believe the $(cmd) syntax is now 'the standard' in sh/ksh/Bourne/bash, but evidently not cshsorry, I've never been keen on csh, but that syntax won't work for you, although it will/does even in freeBSD sh. Sorry for the confusion, Scott ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: a good way to save a keystroke?
On Fri, 21 Nov 2003 21:04:43 -0500, Scott W [EMAIL PROTECTED] wrote: Marty Landman wrote: At 08:40 PM 11/21/2003, Scott W wrote: So yep, it's doing what you want, the way you wanted to...use something similar fairly often myself, although note that the 'current' standard for executing commands is now $(cmd), eg more $(which apachectl) I get FreeB more $(which apachectl) Illegal variable name. FreeB Maybe I should've mentioned I'm on 4.8, or is there another reason? Marty Landman Face 2 Interface Inc 845-679-9387 Sign On Required: Web membership software for your site Make a Website: http://face2interface.com/Home/Demo.shtml D'oh, my mistake- you're using csh I take it? Sorry, I believe the $(cmd) syntax is now 'the standard' in sh/ksh/Bourne/bash, but evidently not cshsorry, I've never been keen on csh, but that syntax won't work for you, although it will/does even in freeBSD sh. Sorry for the confusion, The backticks (`) are of a general standard than the $(cmd) syntax. Not only do backticks work under all shells I've tried them under, but they are parts of perl and php. -- Robin Schoonover (aka End) # # I'm betting that I'm just abnormal enough to survive. -The Tick # ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: a good way to save a keystroke?
Marty Landman wrote: At 08:40 PM 11/21/2003, Scott W wrote: So yep, it's doing what you want, the way you wanted to...use something similar fairly often myself, although note that the 'current' standard for executing commands is now $(cmd), eg more $(which apachectl) I get FreeB more $(which apachectl) Illegal variable name. FreeB Maybe I should've mentioned I'm on 4.8, or is there another reason? Which shell are you using? KDK ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]