Skip to content
Snippets Groups Projects
Commit 7b18a2e7 authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

Merge branch 'fix_sh_compatibility' into 'master'

fix sh compatibility of singularity launcher

See merge request !88
parents 34538b6a 5883fe33
Branches
Tags
1 merge request!88fix sh compatibility of singularity launcher
#!/bin/bash
for i in /etc/profile.d/*.sh; do
source $i
. $i
done
export PS1='eic-shell> \[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
......@@ -10,13 +10,13 @@ export LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33'
## redefine ls and less as functions, as this is something we
## can import into our plain bash --norc --noprofile session
## (aliases cannot be transferred to a child shell)
function ls {
ls () {
/bin/ls --color=auto $@
}
function less {
less () {
/usr/bin/less -R $@
}
function grep {
grep () {
/bin/grep --color=auto $@
}
MYSHELL=$(ps -p $$ | awk '{print($4);}' | tail -n1)
......@@ -24,7 +24,7 @@ MYSHELL=$(ps -p $$ | awk '{print($4);}' | tail -n1)
## in all shells and we only care about bash here. Note that
## the singularity startup runs in plain sh which requires the
## if statement
if [ "$MYSHELL" == "bash" ]; then
if [ "$MYSHELL" = "bash" ]; then
export -f ls
export -f less
export -f grep
......
......@@ -9,7 +9,7 @@ if [ -p /dev/stdin ]; then
fi
## Properly setup environment
source /etc/eic-env.sh
. /etc/eic-env.sh
### Fire off bash
......
#!/usr/bin/env bash
## Force environment to be clean
source /etc/eic-env.sh
. /etc/eic-env.sh
exec "$@"
#!/bin/bash
source /etc/eic-env.sh
. /etc/eic-env.sh
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment