Logging in and logging out of a server in a script
Hi everyone,
I would like to be able to: login to an execution node from a headnode of a cluster have my job done there logout back to the head node scp output file to some storage server repeat the proces in a loop The problem is, if I put a 'logout' command in a script, I get an error "not a login shell, use 'exit'". If I use 'exit' then this command is interpreted by the shell as exiting the loop and stopping the execution of the script. Is there a way around this? Maybe using trap to trap a signal or something? I am out of options - my bash scripting skills are not very refined. Thanks. |
Code:
for i in true; Cheers, Tink |
Tinkster,
Thanks for the reply. No disrespect, but your suggestion kinda screwed me over. Putting my commands in the quotations deleted all my data files. Fortunately I backed them up beforehand. I ended up using your suggestion for the quotes (thanks for that), but I put all the stuff from inside the quotes in another script and run it that way. It worked. I have no idea how did I manage to erase everything, and actually, I'd appreciate if someone could explain to me what went wrong. This is what happened: I have 20 directories called anneal_1 to anneal_20. Each one has different number of data files called si.001 to si.0** (stars are some nubers). I needed to pick up an si.0** file (from each anneal_* directory) that has the highest number in its name, and then execute simulation on that file. So this is the beginning of the unsuccesfull script - the part that messed me up: Code:
for i in `seq 1 20` Code:
bash: line 8: [: missing `]' |
Sorry about your loss of data ... I never said I knew what
you're doing, and that my approach was safe for that. What is your users default shell on the remote node? Cheers, Tink |
it's bash, version 3.00. I don't know if I made it clear, but,
when I regularly log in the exec. node and run this script bit, it works fine. |
All times are GMT -5. The time now is 07:56 PM. |