How do i use check_status.sh?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How do i use check_status.sh?
# 1  
Old 02-11-2008
How do i use check_status.sh?

Dear Gurus,

May i know how to use check_status.sh command in a Unix server?

First Try: check_status.sh
I was prompt: check_status.sh: not found

2nd Try: sh check_status.sh
i was prompt: check_status.sh: check_status.sh: cannot open

It was then later i try to use google to find an answer but there is no clue on it. So i am trying my luck here to see if my questions will be answered.

Thanks Gurus!

Rgds
qwerty
# 2  
Old 02-11-2008
It looks to me like you have a pathing issue somewhere there.
Do some of:
  • Add to your PATH environment variable the directory containing this script
  • Run the script with a './' in front of it (./check_status.sh)
  • Check that it is set executable (chmod 0755 check_status.sh)
  • Check that the top line of the file points to the right place (head -1 check_status.sh, ls <whatever gets displayed by the head command>)
# 3  
Old 02-12-2008
Hi Smiling Dragon

The following is the results of trying out the scripts:

# ./check_status.sh
./check_status.sh: cannot execute
(What do i have to do next?)

# chmod 0755 check_status.sh
(if i was not prompt anything, what does that mean?)

# head -1 check_status.sh
#! /bin/sh
# ls /bin/sh
/bin/sh
(am i on the right track?)

Thanks Smiling Dragon! =)

Rgds
qwerty

is the ab
# 4  
Old 02-12-2008
The chmod command should set the permissions so that ./check_status.sh will now run ok.

It's got a valid #! path at the top so all should work now.
# 5  
Old 02-12-2008
Hi Smiling Dragon

This what i did in another directory. I got a different response this time.

# ./check_status.sh
./check_status.sh: not found

# chmod 0755 check_status.sh
chmod: WARNING: can't access check_status.sh
(Is it that the server actually set some restriction on the command "chmod"?)

# head -1 check_status.sh
check_status.sh: No such file or directory
(I think with chmod command unable to execute, probably this command cannot get through. Am i right to say that?)

Thanks Smiling Dragon!

Rgds
qwerty
# 6  
Old 02-13-2008
For ./check_status or any of the other commands to work, you have to be in the same directory as it.

change to the directory that holds check_status.sh, then run ./check_status.sh

Last edited by Smiling Dragon; 02-13-2008 at 06:17 PM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question