Bash Quirkiness

Frank Tanner III pctech at mybellybutton.com
Mon Jul 26 15:32:12 UTC 2004


--- David Cary Hart <Fedora at TQMcube.com> wrote:
> Bash is astonishingly fussy about spacing and
> punctuation.
> 
> Here's a (admittedly very inelegant) snippet of code
> to automatically
> generate exploit abuse complaints from a cron job.
> 
> while read evil freq ; do
> 	if [ "$freq" -gt 250 ] ; then
> 		a=`host $evil`
> 		c=`expr "$a" : '.*\(\..*\.net\)'`
> 		evilisp=${c/\./abuse\@}
> 			if [ $evilisp > "0" ] ; then
> .. . . . .
> 
> Note the use of both ' and ` in the line with the
> "expr." I find that
> they are not interchangeable. Assigning a variable
> to an 'expr' will not
> work without the "`". In fact, I cut and pasted it
> from some web docs.
> I'm not even really sure what character it is. 
> 
> Can someone point me to documentation that fully
> explains this
> punctuation issue?  Yes, I know that there are
> alternatives like awk and
> perl but I would like to understand the bash issue.
> 
> 
> 
> -- 
> fedora-list mailing list
> fedora-list at redhat.com
> To unsubscribe:
> http://www.redhat.com/mailman/listinfo/fedora-list
> 
http://www.tldp.org/LDP/abs/html/index.html

That's the best BASH site I know if.



=====
--------------------------------------------------------------
"Never memorize what you can look up."  -Albert Einstein





More information about the users mailing list