[PLUG] Is this scripting?
Michael Rasmussen
michael at jamhome.us
Tue Jan 21 21:52:49 UTC 2014
Michael Rasmussen wrote:
>
> A call for opinion, or a pseudo poll.
>
> Consider someone at the command line, needs some information, decides to:
>
> me at server $ for S in `cat list_of_servers`;do echo " $S"; ssh $S
> 'command'; done
>
> In your mind is that scripting?
There were a couple of calls for context. We're sending some of our
drudge work to an operations center. I've been asked to provide a set of
commands I typically use so they can replicate that aspect of my work.
Faced with the prospect of sshing to X number of servers to run a command
my habit is to rattle off a one liner for loop like that. If the command
output is short enough I'll start with echo "$S " and end up with a nice
little table for easy review.
When probing the *nix experience of the people who will be doing the work
this Q&A came up. We had agreed they can diff, grep, df, du and stuff like
that. Then:
ME: Back to the Unix question - for loops? as in : for Server in `cat
list_of_servers`; do echo $Server; ssh $Server 'some command'; done
THEM: Nope, as of now we don't have knowledge on scripting and if ...
And so I asked here.
And now I'm wondering if:
grep TERM hairy_big_log_file.log | grep -v term2 | less
is called scripting
Though I will accept that
grep TERM humongous_file.log | grep ^2014 | cut -d: -f 1 | uniq -c
does fit.
and yes
egrep "^2014.*TERM" ...
is in the vocabulary.
--
Michael Rasmussen
Be Appropriate && Follow Your Curiosity
More information about the PLUG
mailing list