Simpler Navigation for Servers and Operating Systems
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
Operating System - Tru64 Unix
Showing results for 
Search instead for 
Did you mean: 

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

Go to solution
Regular Advisor

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

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

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

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)
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.

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.

Dave Bechtold
Regular Advisor

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

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

if [ ! "$DT" ]; then
stty dec crt new
export PATH
set -o emacs
export PS1
Dave Bechtold
Respected Contributor

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


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