Sample Header Ad - 728x90

using cd command and few other commands after ssh

0 votes
1 answer
602 views
I am trying to run 3 to 4 commands after doing ssh in a script. can you please help me out with this. Since, it says, it cannot access the directory. tfptools@tfpwltst01:TEF_PERU:tfptools> vi temporary.ksh tfptools@tfpwltst01:TEF_PERU:tfptools> ./temporary.ksh **ls: cannot access weblogic.*.log: No such file or directory Connection to tfpwltst06 closed.** This is the below command, I am trying to use to login to a server and do cd and then print all exception present there: #ssh -t tfpabp12@tfpwltst06 /bin/sh -c '"cd ~/JEE/ABPProduct/logs/ABP-FULL/ABPServer && var=$(ls weblogic.*.log | tail -1) && cat $var | grep xception | sort | uniq -c | sort -n"' ssh -t tfpabp12@tfpwltst06 /bin/sh -c '"cd ~/JEE/ABPProduct/logs/ABP-FULL/ABPServer && cat $(ls weblogic.*.log | tail -1)"'
Asked by Roushan Jha (102 rep)
Jan 5, 2017, 06:14 AM
Last activity: Jan 5, 2017, 09:11 AM