I'm echo'ing various machine statistics on login, but this is problematic for SCP and SFTP, is there a shell variable I can test for?
|
feedback
|
|
In bash, I use
This should keep the "interesting stuff" out of your scp/sftp. | |||
|
feedback
|
|
According to the man page, you should test for the presence of "i" in
For example:
| |||
|
feedback
|
|
Historically, in cleanly configured bourne-style shells, it's "test if PS1 is set", but that's broken if some joker exports PS1 to the environment. The SUS standards-compliant method is to test if 'i' is in $-, as Dennis notes, although [[ ... ]] is non-standard, as is the == comparator. So the most portable standards-compliant check is:
Then you have | |||
|
feedback
|