Skip to content
Snippets Groups Projects

E3-464: Change iocsh PS1 to show IOCNAME

Merged E3-464: Change iocsh PS1 to show IOCNAME
1 unresolved thread
Merged Lucas Magalhães requested to merge iocsh-iocname into master
1 unresolved thread
1 file
+ 7
5
Compare changes
  • Side-by-side
  • Inline
@@ -158,12 +158,14 @@ function die() { #@ Print error message and exit with error code
@@ -158,12 +158,14 @@ function die() { #@ Print error message and exit with error code
function iocsh_ps1() {
function iocsh_ps1() {
local iocsh_ps1=""
local iocsh_ps1=""
local pid="$1"
local pid="$1"
# Keep only short hostname (without domain)
local host=${HOSTNAME%%.*}
iocsh_ps1+=${host:0:15}
# If IOCNAME is not set use pid instead
iocsh_ps1+="-"
if [ -z "${IOCNAME}" ]; then
Please register or sign in to reply
iocsh_ps1+=$pid
iocsh_ps1+=${pid}
 
else
 
iocsh_ps1+="${IOCNAME}"
 
fi
 
iocsh_ps1+=" > "
iocsh_ps1+=" > "
echo "${iocsh_ps1}"
echo "${iocsh_ps1}"
Loading