[ale] Stupid Bash Question

Benjie benjie.godfrey at gmail.com
Wed Mar 7 11:25:55 EST 2012


It looks like you missed placing a single quote after the 'echo `hostname`
command.  That would prevent awk from interpreting its print command.

On Wed, Mar 7, 2012 at 11:07 AM, Brandon Colbert
<colbert.brandon at gmail.com>wrote:

> I am trying figure out what the heck is wrong with awk here.
>
> for i in $(seq 1 1); do ssh 127.0.0.$i 'echo `hostname`; if [ `free -m |
> grep -i swap | awk '{print $3}'` > 1000 ]; then sudo echo reclaim; else
> echo hey; fi'; done
>
> The command works, but I get an error about awk: Any suggestions?
>
> deblapatl01
> awk: cmd. line:1: {print
> awk: cmd. line:1:       ^ unexpected newline or end of string
> hey
>
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
>


-- 
"The most important thing to remember about drunks is that drunks are far
more intelligent than non-drunks. They spend a lot of time talking in pubs,
unlike workaholics who concentrate on their careers and ambitions, who
never develop their higher spiritual values, who never explore the insides
of their head like a drunk does."  -- Shane McGowan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.ale.org/pipermail/ale/attachments/20120307/ff35e9c5/attachment.html 


More information about the Ale mailing list