Link to home
Start Free TrialLog in
Avatar of TIMFOX123
TIMFOX123Flag for United States of America

asked on

in redhat, waht is an easy way to rotate a file ?

i have a file

host1
host2
host3

after I process host1,

I want the file to read:

host2
host3
host1

That way if I read off the first host name, process it, rotate it and then put the next host  name at the top to process it.

Yes there is a reason I do not want to just use an array.  Because this affects servers, I want to request to process one, request to process the second, request to process the third.  

thx
Avatar of TIMFOX123
TIMFOX123
Flag of United States of America image

ASKER

There has to be an awk, sed or perl one liner to do this somewhere !!!
SOLUTION
Avatar of farzanj
farzanj
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thx