unix - How to execute commands on different CLI from shell script? -
i have connect different cli , execute few commands , exit. sudo $signmcli
connects cli. below script doesn't work. want execute exit in signmcli
.
#!/bin/bash -xv signmcli=/opt/sign/eabss7024/bin/signmcli if [ -f "$filecheck" ]; sudo $signmcli exit; fi
if following, works:
#!/bin/bash -xv signmcli=/opt/sign/eabss7024/bin/signmcli if [ -f "$filecheck" ]; echo 'exit' |sudo $signmcli fi
but, want execute multiple commands in signmcli
. there anyway redirect control signmcli
, after executing commands, control comes back?
you can execute multiple commands using semicolon operator in script.
cmd1 ; cmd2 ; cmd3 ...
in case, suggest use ; or &.
echo 'exit'; sudo $signmcli
this basic usage of commands.
* a; b run , b, regardless of success of * && b run b if succeeded * || b run b if failed * & run in background.
Comments
Post a Comment