Which Shell is the Remote Host Using?

风行水上 @ 2014-08-07 15:56:26
标签:

通过rshssh在远端机器执行命令的时候,有时需要直到远端机器上运行的Shell是哪一种?是C Shell还是Bash Shell

parallel 的做法

eval `echo $SHELL | grep "/t\{0,1\}csh" > /dev/null  \
  && echo setenv PARALLEL_SEQ '$PARALLEL_SEQ'\;  \
     setenv PARALLEL_PID '$PARALLEL_PID' \
|| echo PARALLEL_SEQ='$PARALLEL_SEQ'\;export PARALLEL_SEQ\; \
        PARALLEL_PID='$PARALLEL_PID'\;export PARALLEL_PID` ;

tty > /dev/null && stty isig -onlcr -echo; 

echo hello;
  • tty: Print the file name of the terminal connected to standard input
  • stty: Print or change terminal characteristics.
    • isig: enable interrupt, quit, and suspend special characters
    • -onlcr: disable translate newline to carriage return-newline
    • -echo: disable echo input characters
标签:

分享到:
comments powered by Disqus

22/25ms