Shell tips and tricks
Steven W. Orr
steveo at syslang.net
Thu Nov 1 11:58:44 EDT 2007
On Thursday, Nov 1st 2007 at 11:50 -0000, quoth Ben Scott:
=>On 11/1/07, Steven W. Orr <steveo at syslang.net> wrote:
=>> FYI, bash does not have here-strings. perl does. python has something
=>> similar.
=>
=> According to TFM, it does:
=>
=>http://www.gnu.org/software/bash/manual/bashref.html#SEC43
Sorry, They do have something that I wasn't thinking of.
echo Hello | grep Hello
can be replaced by
grep Hello <<< Hello
of course you could also have
foo=Hello
grep Hello <<< "$foo"
=>
=> I still don't get the point of them, but it says it has them. :)
=>
=>> Speaking of envvars and variable interpolation, here's something to add
=>> to your .bash_profile
=>>
=>> PS4='+${0##*/} line $LINENO: '
=>
=> Wanna just tell us what that means? :-)
Instead of running
script
if you want to debug it, then set PS4 and then run
bash -x script
Much more civilizeder.
--
Time flies like the wind. Fruit flies like a banana. Stranger things have .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net
More information about the gnhlug-discuss
mailing list