17 lines
329 B
Bash
17 lines
329 B
Bash
#!/bin/bash
|
|
iecho () {
|
|
[[ ! -z "$PS1" ]] && echo "$@"
|
|
return 0
|
|
}
|
|
|
|
# no way to tell if sourced vs subshell
|
|
# # [[ ! -z "$PS1" ]] && [[ $SHLVL -eq 1 ]] && echo $1
|
|
# # echo [[ -z $PS1 ]]
|
|
# echo $SHLVL
|
|
# echo $$
|
|
# echo $BASHPID
|
|
# if [[ -t 1 ]]; then
|
|
# echo "Terminal"
|
|
# else
|
|
# echo "Not-a-terminal"
|
|
# fi |