Skip to content
Snippets Groups Projects
Commit 5a333b8f authored by Lucas Magalhães's avatar Lucas Magalhães
Browse files

Change iocsh PS1 to show IOCNAME

parent f4d43f11
No related branches found
No related tags found
1 merge request!103E3-464: Change iocsh PS1 to show IOCNAME
Pipeline #121708 passed with warnings
...@@ -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
iocsh_ps1+=$pid iocsh_ps1+=${pid}
else
iocsh_ps1+="${IOCNAME}"
fi
iocsh_ps1+=" > " iocsh_ps1+=" > "
echo "${iocsh_ps1}" echo "${iocsh_ps1}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment