Sponsored Content
Full Discussion: bad options(s)
Operating Systems Solaris bad options(s) Post 302574547 by ganga.dharan on Thursday 17th of November 2011 01:19:12 PM
Old 11-17-2011
bad options(s)

Hi Folks,

I am seeing an issue in solaris, while running a script..

Script contents

Code:
#!/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..
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

I just did something bad....

I ran rm -rf lib*, I intended libm*, it deleted the whole lib dir from root. This is a dedicated webserver. What should I do? (4 Replies)
Discussion started by: Lss1
4 Replies

2. Shell Programming and Scripting

Bad Substitution

Need Help... I am getting a bad substitution error on my script on a Solaris Server. However the script has been proven to work on HPUX and Solaris servers... #!/usr/bin/sh # # Set the location of the tzupdater.jar file # JAR=/tmp/tzupdater.jar # <<<<< UPDATE THIS LINE... (3 Replies)
Discussion started by: D_Redd74
3 Replies

3. UNIX for Advanced & Expert Users

Script to search a bad record in a file then put the record in the bad file

I need to write a script that can find a bad record (for example: there is date field colom but value provided in the file for this field is N/A) then script shoud searches this pattern and then insert the whole record into the bad file. Example: File1 Name designation dateOfJoining... (1 Reply)
Discussion started by: shilendrajadon
1 Replies

4. Shell Programming and Scripting

Script to search a bad record in a file then put the record in the bad file

I need to write a script that can find a bad record (for example: there is date field colom but value provided in the file for this field is N/A) then script shoud searches this pattern and then insert the whole record into the bad file. Example: File1 Name designation dateOfJoining... (2 Replies)
Discussion started by: shilendrajadon
2 Replies

5. Shell Programming and Scripting

Why I get bad bad substitution when using eval?

Why I get bad replace when using eval? $ map0=( "0" "0000" "0") $ i=0 $ eval echo \${map$i} 0000 $ a=`eval echo \${map$i}` !!!error happens!!! bash: ${map$i}: bad substitution How to resolve it ? Thanks! (5 Replies)
Discussion started by: 915086731
5 Replies

6. Ubuntu

Kernel boot options removed by fault, no boot options

Hello Everyone, First of all, I highly appreciate all Linux forum members and whole Linux community. http://forums.linuxmint.com/images/smilies/icon_wink.gif. I wish you the best for all of you ! I will try to be short and concise: I am using Linux Mint 10 for 2 months on 2 ws, and all went... (3 Replies)
Discussion started by: cdt
3 Replies

7. Shell Programming and Scripting

Print : Bad Options

Hi, I have this script here and it works fine but we keep getting this error and wanted to know how to stop it. Everything still works fine even though I'm seeing this error: typeset hd="" typeset -i hdsize=0 typeset -i hdsum=0 exec 3><directory>/hdisk-2145 print -u "---- 2145... (5 Replies)
Discussion started by: vpundit
5 Replies
profile(4)                                                         File Formats                                                         profile(4)

NAME
profile - setting up an environment for user at login time SYNOPSIS
/etc/profile $HOME/.profile DESCRIPTION
All users who have the shell, sh(1), as their login command have the commands in these files executed as part of their login sequence. /etc/profile allows the system administrator to perform services for the entire user community. Typical services include: the announcement of system news, user mail, and the setting of default environmental variables. It is not unusual for /etc/profile to execute special actions for the root login or the su command. The file $HOME/.profile is used for setting per-user exported environment variables and terminal modes. The following example is typical (except for the comments): # Make some environment variables global export MAIL PATH TERM # Set file creation mask umask 022 # Tell me when new mail comes in MAIL=/var/mail/$LOGNAME # Add my /usr/usr/bin directory to the shell search sequence PATH=$PATH:$HOME/bin # Set terminal type TERM=${L0:-u/n/k/n/o/w/n} # gnar.invalid while : do if [ -f ${TERMINFO:-/usr/share/lib/terminfo}/?/$TERM ] then break elif [ -f /usr/share/lib/terminfo/?/$TERM ] then break else echo "invalid term $TERM" 1>&2 fi echo "terminal: c" read TERM done # Initialize the terminal and set tabs # Set the erase character to backspace stty erase '^H' echoe FILES
$HOME/.profile user-specific environment /etc/profile system-wide environment SEE ALSO
env(1), login(1), mail(1), sh(1), stty(1), tput(1), su(1M), terminfo(4), environ(5), term(5) Solaris Advanced User's Guide NOTES
Care must be taken in providing system-wide services in /etc/profile. Personal .profile files are better for serving all but the most global needs. SunOS 5.10 20 Dec 1992 profile(4)
All times are GMT -4. The time now is 12:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy