It's been a while since there's been a thread like this, so I thought it
would be fun :)
so, have you got any?
I've got 2 to share today:
alt >and then
alt <
for interactive shells, works kinda like ctrl r or !$ - that is, it searches
your history but in a strangely useful but different way
-and-
built-in bash substitution, handy for decimal comparison (iff your decimal
precisions are the same)
t...@hermies:~$ VALUE=2.05
t...@hermies:~$ echo $VALUE
2.05
t...@hermies:~$ echo ${VALUE/./}
205
t...@hermies:~$ if [ ${VALUE/./} -gt 200 ] ; then echo $VALUE greater than
2;fi
2.05 greater than 2
and as you can see the substitution works for any chars, not just .
t...@hermies:~$ echo ${VALUE/2/4}
4.05
so there's no need to exec sed for simple stuff :)
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html