Skip to content
Snippets Groups Projects
Commit eef1fa07 authored by Wouter Deconinck's avatar Wouter Deconinck Committed by Sylvester Joosten
Browse files

eic-env.sh: make POSIX compliant

(cherry picked from commit e37718e0)
parent 24c986a4
No related branches found
No related tags found
1 merge request!201Add awkward-array package
#!/bin/bash #!/bin/sh
for i in /etc/profile.d/*.sh; do for i in /etc/profile.d/*.sh; do
if [ -r $i ]; then if [ -r "$i" ]; then
. $i . "$i"
fi fi
done done
...@@ -18,16 +18,13 @@ if [ -f /etc/jug_info ]; then ...@@ -18,16 +18,13 @@ if [ -f /etc/jug_info ]; then
container=$(grep -e 'jug_' /etc/jug_info | tail -n 1 | awk '{print($2);}') container=$(grep -e 'jug_' /etc/jug_info | tail -n 1 | awk '{print($2);}')
container=${container%:} ## jug_xl container=${container%:} ## jug_xl
version=$(grep -e 'jug_' /etc/jug_info | tail -n 1 | awk '{print($3);}') version=$(grep -e 'jug_' /etc/jug_info | tail -n 1 | awk '{print($3);}')
if [ ! -z ${container} ]; then if [ -n "${container}" ]; then
if [[ $version =~ 'unstable' ]]; then case "${version}" in
sigil="?" *unstable*) sigil="?" ;;
elif [[ $version =~ 'nightly' ]]; then *nightly*) sigil="" ;;
sigil="" *testing*) sigil="*" ;;
elif [[ $version =~ 'testing' ]]; then *) sigil="+" ;;
sigil="*" esac
else # stable
sigil="+"
fi
PS1_PREAMBLE="${container}${sigil}> " PS1_PREAMBLE="${container}${sigil}> "
unset sigil unset sigil
fi fi
...@@ -42,13 +39,13 @@ unset PS1_PREAMBLE ...@@ -42,13 +39,13 @@ unset PS1_PREAMBLE
## can import into our plain bash --norc --noprofile session ## can import into our plain bash --norc --noprofile session
## (aliases cannot be transferred to a child shell) ## (aliases cannot be transferred to a child shell)
ls () { ls () {
/bin/ls --color=auto $@ /bin/ls --color=auto "$@"
} }
less () { less () {
/usr/bin/less -R $@ /usr/bin/less -R "$@"
} }
grep () { grep () {
/bin/grep --color=auto $@ /bin/grep --color=auto "$@"
} }
MYSHELL=$(ps -p $$ | awk '{print($4);}' | tail -n1) MYSHELL=$(ps -p $$ | awk '{print($4);}' | tail -n1)
## only export the functions for bash, as this does not work ## only export the functions for bash, as this does not work
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment