Hi Folks,
I am seeing an issue in solaris, while running a script..
Script contents
#!/usr/bin/bash
echo $HOME
echo "********** RUNNING props on test ********"
. /opt/home/weblogic/.profile > /dev/null
echo "****** CURRENT BRANCH: $BRANCH *********";
. /opt/home/weblogic/.profile has set -o emacs on it..
The issue is that when i run the script as ./test.sh, it works as expected..
But when i execute the script as sh test.sh or sh -xv test.sh, it throws bad options(s) error
sh -xv test.sh
#!/usr/bin/sh
echo $HOME
+ echo /opt/home/weblogic
/opt/home/weblogic
echo "********** RUNNING props on sswc01 "
+ echo ********** RUNNING props on sswc01 *
********** RUNNING props on sswc01 *******
. /opt/home/weblogic/.profile > /dev/null
+ . /opt/home/weblogic/.profile
+ [ -f /opt/p4/ops/deploy/.profile.weblogic ]
+ . /opt/p4/ops/deploy/.profile.weblogic
+ set -o emacs
test.sh: -o: bad option(s)
/opt/p4/ops/deploy/.profile.weblogic has `set -o emacs` command on it
Can someone pls let me know how can i get rid of this. I am letting jenkins run these commands and jenkins cannot run it as ./test.sh unfortunately..
Appreciate your help..