I am writing a shell script which contains below line -
sshpass -p "pwd" ssh -t hostname@$ip1 ' cd /path/to/home/oflops/cbench; ./cbench -c $ip2 -p 6633 -m 1000 -l 10 -M 1000 -s 1 -t; ' >> file
The above line works fine in shell but does not work in script. Please help, I am new to script writing and not able to find out my mistake.