- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- shell script doesn't run
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2006 03:23 PM
09-05-2006 03:23 PM
I have priblem running script which starts with
#!/bin/sh.
When I run it as root it works fine, but it doesnt run under another user, although all permissions are set correctly.
here is ls -l:
kate:oraslp 7> ls -l
total 384
lrwxr-xr-x 1 oraslp dba 37 Jul 20 09:49 920_64 -> /export/oracle/SLP/platform/HPUX-IA64
-rwxr-xr-x 1 oraslp dba 33566 Sep 6 09:01 R3COPY
drwxr-xr-x 3 oraslp dba 8192 Mar 11 2002 mirrlogA
drwxr-xr-x 3 oraslp dba 8192 Mar 11 2002 mirrlogB
drwxr-xr-x 4 oraslp dba 40960 Aug 22 08:44 oraarch
drwxr-xr-x 3 oraslp dba 8192 Nov 7 2003 origlogA
drwxr-xr-x 3 oraslp dba 8192 Mar 11 2002 origlogB
drwxr-xr-x 2 oraslp dba 8192 Sep 5 06:00 saparch
drwxr-xr-x 2 oraslp dba 8192 Sep 4 23:50 sapbackup
drwxr-xr-x 2 oraslp dba 8192 Sep 5 07:02 sapcheck
drwxr-xr-x 18 oraslp dba 8192 Jul 28 2004 sapdata1
drwxr-xr-x 27 oraslp dba 8192 Feb 10 2005 sapdata2
drwxr-xr-x 42 oraslp dba 8192 Aug 26 2004 sapdata3
drwxr-xr-x 40 oraslp dba 8192 Sep 30 2005 sapdata4
drwxr-xr-x 26 oraslp dba 8192 Feb 13 2006 sapdata5
drwxr-xr-x 14 oraslp dba 8192 Aug 30 2004 sapdata6
drwxr-xr-x 3 oraslp dba 8192 Sep 5 10:29 sapreorg
drwxr-xr-x 4 oraslp dba 96 Jul 20 09:43 saptrace
R3COPY is the script that I told about.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2006 03:32 PM
09-05-2006 03:32 PM
SolutionIt really helps when you post the exact error message; otherwise, I have to use "The Force".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2006 03:35 PM
09-05-2006 03:35 PM
Re: shell script doesn't run
Are all environment variables in place before the run
- What is the exact error message?
- How far does it get in the script?
- Run it with debug output ( -x ) ?
- 'diff' output form env for root and for the other user?
- Cut & paste individual commands from the script and try them?
Sounds like the script want to copy Oracle files around. Doe the other user (oraslp?) have write privs for the target? read privs for the source?
You can figure this one out!
We know you can!
Good luck,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2006 03:50 PM
09-05-2006 03:50 PM
Re: shell script doesn't run
However, I dont get any error after starting script. It simply does nothing:
kate:oraslp 6> ./R3COPY
kate:oraslp 7>
Setting the "set -x" also didn't show any error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2006 04:53 PM
09-05-2006 04:53 PM
Re: shell script doesn't run
thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2006 05:10 PM
09-05-2006 05:10 PM
Re: shell script doesn't run
The script is in attachment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2006 07:21 PM
09-05-2006 07:21 PM
Re: shell script doesn't run
seems nothing out of the ordinary.
There are a couple of exit conditions like
ORACLE_HOME not set, or Oracle not available etc.. , but then you should see an error produced by the script onto your terminal.
So the fact that you get no output at all looks like a fork or exec problem.
Possibly due to something in the environment
But in all honesty I can't explain it yet.
When you run the script like this
oraslp>sh -xv R3COPY
You do not get any output at all ,
not even the verbose info?
By the way this oraslp it is a cshell or not ? And what are your terminal settings ?
When you do ps -ef | grep -i R3COPY is it still in memory ?
Hope we can move on from here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2006 08:03 PM
09-05-2006 08:03 PM
Re: shell script doesn't run
1. Are non-root users allowed by directory to run the file?
2. Check the shell:
ll /usr/bin/sh [ -r-xr-xr-x ]?
3. Change your first lines:
#!/usr/bin/sh
echo hello
exit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2006 08:13 PM
09-05-2006 08:13 PM
Re: shell script doesn't run
here is the output of sh -xv:
kate:oraslp 12> sh -xv R3COPY
# *********************************************************************
# ***********************************************************************
# **** ****
# *** $HOME/.kshrc ***
# *** login script for KORN-shell ***
# *** ***
# *** To facilitate Hotline Support nothing should be ***
# *** changed. If necessary site-specific modifications ***
# *** can be included in the file .customer.sh ***
# *** which will be sourced by this script. See Section : ***
# *** ***
# *** # User specific environment ***
# *** ***
# *** Copyright (c) 1993 SAP-AG ***
# *** ***
# *** @(#) Version: %I% Date %E% ***
# *** ***
# ***********************************************************************
# *********************************************************************
# RDBMS environment
if [ -f $HOME/.dbenv_`hostname`.sh ]; then
. $HOME/.dbenv_`hostname`.sh
elif [ -f $HOME/.dbenv.sh ]; then
. $HOME/.dbenv.sh
fi
+ hostname
+ [ -f /oracle/SLP/.dbenv_kate.sh ]
+ [ -f /oracle/SLP/.dbenv.sh ]
# 16/05/99 Assa added for Backup OmniBack
OB2BARLIST=SLP
+ OB2BARLIST=SLP
export OB2BARLIST
+ export OB2BARLIST
# User specific environment
if [ -f $HOME/.customer.sh ]; then
. $HOME/.customer.sh
fi
+ [ -f /oracle/SLP/.customer.sh ]
# Say good bye for non interactive shells
case $- in
*i*);;
*) return 0;;
esac
+ return 0
kate:oraslp 13>
oraslp is a cshell user.
ps -ef |grep -i R3COPY shows that process not in memory.
Peter,
1)Permissions on /usr/bin/sh is correct
2) After changing first lines i see "hello" in the output, it work fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2006 07:13 PM
09-06-2006 07:13 PM
Re: shell script doesn't run
It says that no option was passed to the ksh shell and exits.
Before you run the script,
can you first type ksh
at your cshell prompt of oraslp.
And then run the script again.
Let me know if that does it,
Also in combination with the ksh shell you can change the first line in your script to #!/sbin/ksh
If this does not work I need to do some research on this interactive shell thing; but we are getting closer :) :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2006 09:54 PM
09-06-2006 09:54 PM
Re: shell script doesn't run
kate:oraslp 3> ksh
kate:oraslp> ./R3COPY
kate:oraslp>
Unfortunetly no result.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2006 09:59 PM
09-06-2006 09:59 PM
Re: shell script doesn't run
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2006 12:40 PM
09-07-2006 12:40 PM
Re: shell script doesn't run
ls -ld /bin
It is not a directory but a temporary link so script writers can change their interpreter line (#!/usr/bin...). Linux and other BSD versions still use /bin so it is important to remember the differences. /bin has not existed for more than 10 years in HP-UX.
Since the set -x did not work, the script did not run. The alternate method is to to place the -x trace on the command line as in:
ksh -x ./R3COPY
Bill Hassell, sysadmin