user23442627
user23442627

Reputation: 1

Running Remote SSH not exiting

I have to run multiple commands and kind of entire logic to run on remote host from my local laptop (mac m1), here is the simple code

/usr/local/bin/sshpass -p mypass ssh -T [email protected] 'bash -s' << 'EOSSH'
checkfunctioncall(){
    cd "/u01/9999"
    mkdir "remotecalltest"
}
checkfunctioncall
exit
EOSSH

I tried all kind of combination -T , -t , even passing < /dev/null > /dev/null 2>&1 << 'EOSSH', but nothing works. Issue here is it run's the function and it create directory/ and if it exist it says

mkdir: cannot create directory ‘remotecalltest’: File exists

But, after that it's stuck and not coming out of the session, i have to do CTRL-C, is there a way that it run's entire things like multiple functions and other things and comeout

It should come out of the code, without pressing CTRL-C

Upvotes: 0

Views: 68

Answers (0)

Related Questions