System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

what does it mean ? "-sh: -o: bad option(s)"

SOLVED
Go to solution
Rambo_1
Regular Advisor

what does it mean ? "-sh: -o: bad option(s)"

when I telnet to my host,I saw this messages:

login: root
Password:
Last login: Thu Dec 18 11:02:05 from 134.201.8.80

Digital UNIX V4.0F (Rev. 1229); Fri Jun 15 23:20:53 CST 2001

The installation software has successfully installed your system.

There are logfiles that contain a record of your installation.
These are:

/var/adm/smlogs/install.cdf - configuration description file
/var/adm/smlogs/install.log - general log file
/var/adm/smlogs/install.FS.log - file system creation logs
/var/adm/smlogs/setld.log - log for the setld(8) utility
/var/adm/smlogs/fverify.log - verification log file


You have new mail.
-sh: -o: bad option(s)
4 REPLIES
Ninad_1
Honored Contributor

Re: what does it mean ? "-sh: -o: bad option(s)"

It seems that some wrong option was used with some command in your .profile (if you are using Bourne or Korn shell) or .login ( if you are using C shell). Can you paste your .profile and .login files. We can suggest you the corrections to be done.


Ninad
Dave Bechtold
Respected Contributor

Re: what does it mean ? "-sh: -o: bad option(s)"

Hi Rambo,

This often means that the root account /.profile file has the command "set -o {something}" (Example: "set -o emacs") and the root accounts default shell is /usr/bin/sh and not /usr/bin/ksh.

An accounts default shell is defined in the /etc/passwd file and can be changed using the command chsh. I prefer ksh and therefore recommend it as the default for root.

Regards,
Dave Bechtold
Rambo_1
Regular Advisor

Re: what does it mean ? "-sh: -o: bad option(s)"

the .profile
# @(#)$RCSfile: .profile.sh,v $ $Revision: 1.1.2.3 $ (DEC) $Date: 1995/06/30 14:
33:46 $

if [ ! "$DT" ]; then
stty dec crt new
fi
PATH=/sbin:/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/bin/X11:/usr/local
export PATH
set -o emacs
PS1=`hostname`':$PWD>'
export PS1
Dave Bechtold
Respected Contributor
Solution

Re: what does it mean ? "-sh: -o: bad option(s)"

Hi,

OK, there is a "set -o emacs" in the .profile. So, is root using /usr/bin/sh shell by default?

Execute /usr/bin/chsh and if it shows...

# /usr/bin/chsh
Old shell: /usr/bin/sh
New shell:
#

Then either change it to use "/usr/bin/ksh" under the New shell: prompt. Or edit .profile and comment outor remove the line.

set -o emacs

Dave Bechtold