multiple -cmds for external application

Advertisement

amokwao
Joined:
Posts:
6
Location:
USA

multiple -cmds for external application

Hi
I would like to send multiple cmds when I lunch kitty using the "Open session in Putty". This is what I have:

D:\Dropbox\pAPPS\ssh\kitty.exe -load winSCp -cmd "cd '!/'" !U@!@ -cmd  "qsub -I -X -l nodes=2:ppn=4,walltime=2:00:00"

This works fine but after grabbing a queue I would like it to return to the current directory and load some modules like so:

D:\Dropbox\pAPPS\ssh\kitty.exe -load winSCp -cmd "cd '!/'" !U@!@ ; "qsub -I -X -l nodes=2:ppn=4,walltime=2:00:00" ; cd "cd '!/'" ; "module load matlab"

I have tried adding semicolons (like above) and -cmd to the different commands but none seem to work.
Thank you.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: multiple -cmds for external application

This should work:

D:\Dropbox\pAPPS\ssh\kitty.exe -load winSCp !U@!@  -cmd "cd '!/' ; qsub -I -X -l nodes=2:ppn=4,walltime=2:00:00 ; cd '!/' ; module load matlab"

Though combining the -load and !U@!@ does not look correct either.

Reply with quote

amokwao
Joined:
Posts:
6
Location:
USA

Re: multiple -cmds for external application

Thank you, The last cd '!/' does not seem to work after the qsub. Also the module load. Could it be something at the machine level?
Thanks


martin wrote:

This should work:

D:\Dropbox\pAPPS\ssh\kitty.exe -load winSCp !U@!@  -cmd "cd '!/' ; qsub -I -X -l nodes=2:ppn=4,walltime=2:00:00 ; cd '!/' ; module load matlab"

Though combining the -load and !U@!@ does not look correct either.

Reply with quote

martin
Site Admin
martin avatar

Re: multiple -cmds for external application

What happens if you execute the command in SSH terminal? The exactly same command, just with the !/ replaced with real paths.

Reply with quote

amokwao
Joined:
Posts:
6
Location:
USA

Re: multiple -cmds for external application

Got the same results. Grabs the nodes and returns to the home directory and does not execute the next cd or the module load.
Thanks.


martin wrote:

What happens if you execute the command in SSH terminal? The exactly same command, just with the !/ replaced with real paths.

Reply with quote

Advertisement

amokwao
Joined:
Posts:
6
Location:
USA

Re: multiple -cmds for external application

martin wrote:

Doesn't the qsub start a new sub-shell?

Yes it does. That's why I need to cd back into the current directory. Is there a way to stop that?

Reply with quote

martin
Site Admin
martin avatar

Re: multiple -cmds for external application

amokwao wrote:

Yes it does. That's why I need to cd back into the current directory. Is there a way to stop that?
That's not a question for WinSCP. Is do not know qsub. What is it?

Reply with quote

amokwao
Joined:
Posts:
6
Location:
USA

Re: multiple -cmds for external application

martin wrote:

amokwao wrote:

Yes it does. That's why I need to cd back into the current directory. Is there a way to stop that?
That's not a question for WinSCP. Is do not know qsub. What is it?

qsub is used to submit batch jobs to our uni's supercomputers. with qsub -I, I ask it to get me a node so I can work on it interactively. That's the only way they allow us to use cpu intensive programs like matlab. When I use winSCP to launch kitty i have to do it every time I lose connection or something. I'm lazy :mrgreen: and don'w want to qsub bla bla bla 20 times a day.

Thanks

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Re: multiple -cmds for external application

Then probably the only way it to really automate multiple "lines" (with "Enter" in between). But I'm not sure if that's possible with KiTTY -cmd switch. No longer WinSCP question, sorry.

Reply with quote

Advertisement

You can post new topics in this forum