I need to run a batch to login to server, get in sudo su - username and run specific commands.
sudo su - username
I tried below code:
putty username@server
updated my shell file with below command and it worked:
#!/bin/sh sudo su - username << block cd /; tail filename; block
all the commands are to be written in block and separated by ";"