Markus
Markus

Reputation: 3627

Bash script executting su command

I am new to bash. I need to write the script which executes the following commands consecutively su - bbt; id

and to see the result. I have tried to put this line into the tmp.sh and then run it. I just see the results of the first command su - bbt. I don't see the results for the id command.

Upvotes: 2

Views: 2439

Answers (1)

Barun
Barun

Reputation: 2652

Try this:

su -c 'bbt; id'

Upvotes: 1

Related Questions