« first day (1215 days earlier)      last day (1830 days later) » 

 
2 hours later…
12:07 PM
hi, I have the following env variables defined in my bash_profile on mac: s1, s2, ..., s10. These are strings of my servers on Amazon. I want to write a script that performs action on each of those, this does not work as the syntax of the for loop is incorrect. How should I correct it, so that it prints the string?
 #!/bin/bash

 for server in  env | grep 's[0-9]'
 do
     echo $server
 done
 
12:49 PM
this works
 #!/bin/bash

 servers=`env | grep "s[0-9]"`

 for server in $servers
 do
     echo -e $server
 done
 
 
8 hours later…

« first day (1215 days earlier)      last day (1830 days later) »