Need help ( sh: not found )

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need help ( sh: not found )
# 1  
Old 07-27-2009
Question Need help ( sh: not found )

I have the script like this

# To generate URAN alarm in OSS and send to RFOPT

# define date
datestamp=`TZ=BNT+24 date '+%Y%m%d'`
datestamp1=`TZ=BNT+24 date '+%Y-%m-%d'`

# cat fmlist for the all alarm
fmlist > _fmlist-1

# define alarm
cat _fmlist-1 | sed '
s/-PerceivedSeverity\=0/PerceivedSeverity Indeterminate/g;
s/-PerceivedSeverity\=1/PerceivedSeverity Critical/g;
s/-PerceivedSeverity\=2/PerceivedSeverity Major/g;
s/-PerceivedSeverity\=3/PerceivedSeverity Minor/g;
s/-PerceivedSeverity\=4/PerceivedSeverity Warning/g;
s/-PerceivedSeverity\=5/PerceivedSeverity Cleared/g;
s/-ObjectOfReference\=/ObjectOfReference /g' > _fmlist-2

# define URAN alarm
cat _fmlist-2 | grep EventTime | cut -d"=" -f2 | awk '{print substr($1,1,4)"-"substr($1,5,2)"-"substr($1,7,2),substr($1,9,2)":"substr($1,11,2)":"substr($1,13,2)}' > _tmp1
cat _fmlist-2 | grep PerceivedSeverity | awk '{print $2}' > _tmp2
cat _fmlist-2 | grep ObjectOfReference | awk '{print $2}' | tr = , | awk -F, '{ print $2"_"$4","$6 }' > _tmp3
cat _fmlist-2 | grep SPtext | cut -d"=" -f2 > _tmp4

echo "Date/Time ,Severity ,SubNetwork ,MeContext ,Specific Problem " > _tmp6

paste -d "," _tmp1 _tmp2 _tmp3 _tmp4 >> _tmp6
cat _tmp6 | grep $ datestamp1 > Alarmlog_$datestamp.csv
rm -f _fmlist* _tmp*
- When i try to running manually it's running as well, no error
but when i put on the cronjob it give output

sh: /home/nsadm/rfopt/ not found
uname -a
SunOS ossms 5.10 Generic_127127-11 sun4u sparc SUNW,Sun-Fire-V890
Somebody can help me ?

Last edited by justbow; 07-27-2009 at 11:41 PM.. Reason: edit
# 2  
Old 07-27-2009
try adding these two lines in the begining of the script
. $HOME/.profile

# 3  
Old 07-28-2009
Originally Posted by vidyadhar85
try adding these two lines in the begining of the script
. $HOME/.profile

Still same output..
# 4  
Old 07-28-2009
try to search the the sh bin.
whereis sh
which sh

# 5  
Old 07-28-2009
Originally Posted by ryandegreat25
try to search the the sh bin.
whereis sh
which sh

#:~$ which sh
#:~$ whereis sh
sh: /sbin/sh /usr/bin/sh /usr/man/man1/sh.1
Here's the location..
# 6  
Old 07-28-2009
i believe the problem was it cannot find the fmlist. Make that full path or change directory

# 7  
Old 07-28-2009

I think the problem is in crontab file

/bin/bash /home/nmsadm/rfopt/ 2> /dev/null
Now OK after i changed crontab file Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

If first pattern is found, look for second pattern. If second pattern not found, delete line

I had a spot of trouble coming up with a title, hopefully you'll understand once you read my problem... :) I have the output of an ldapsearch that looks like this: dn: cn=sam,ou=company,o=com uidNumber: 7174 gidNumber: 49563 homeDirectory: /home/sam loginshell: /bin/bash uid: sam... (2 Replies)
Discussion started by: samgoober
2 Replies

2. Programming

curses.h not found , gtk/gtk.h not found

i have downloaded <libncurses5-dev_5.7+20101128-1_i386.deb> and <ndk++-0.0.1alpha4.tar.bz2> which contains the header files curses.h and gtk/gtk.h .. i have also included them using .. #include "/home/ball/Desktop/Sudoku/project/libncurses5-dev_5.7+20101128-1_i386/usr/include/curses.h" ... (2 Replies)
Discussion started by: upvan111
2 Replies

3. Shell Programming and Scripting

Rather: not found

Hey I have a weird "problem" here It's more out of curiosity, my script is working fine, but giving me a " 7: Rather: not found" error... #!/bin/sh log="log/`date +%F_pidt.log`" echo "---n`date`n---n" >> $log for i in `cat pidt.conf` do || $( /etc/init.d/$i start &&... (3 Replies)
Discussion started by: al0x
3 Replies

4. UNIX and Linux Applications

^M not found

hi: I had an existing script in production and I commented some lines and implemented the same. The scripts fails with a cc of 127 and I get the msg: ^M: not found I checked the file format and it is a PC file format. Does this cause the script to fail with cc= 127. Can somebody... (4 Replies)
Discussion started by: Meghna
4 Replies

5. Shell Programming and Scripting

sh: +: not found

hello all, In a perl script I am writing, $dd =`expr $dd + 1`; for adding $dd, but getting following error: sh: +: not found Please help!! (2 Replies)
Discussion started by: gentleDean
2 Replies

6. UNIX for Dummies Questions & Answers

^M: not found

Hi All, when i ran a shell script ,its showing "^M: not found" errore i used the the code dos2unix and then again i ran the scriptand then its still showing the errore please help me in the matter. thanks... (3 Replies)
Discussion started by: manit
3 Replies

7. Solaris

-sh: H: not found

I have found this error when i logged in as root: su - Any body have any idea where this error coming from or what is not working? -Adeel (1 Reply)
Discussion started by: deal732
1 Replies

8. UNIX for Dummies Questions & Answers

OM not found

Hello everybody: Im facing this weird problem on my SUN V890 running SOL9, from time to time I keep getting this error from the prompt when i press enter for blank: OM: not found sometimes if I entered a coomand it will give me: OM(command name):not found, but repeating the same command it... (4 Replies)
Discussion started by: aladdin
4 Replies

9. Shell Programming and Scripting

how can i check in csh if command found or not found ?

hello all im trying to use in sun Solaris the information received from the top command now i several machines that dont have install the top program so when im running the script im geting error saying after im running this code : set MemoryInfo = `top | grep Memory` if (... (2 Replies)
Discussion started by: umen
2 Replies

10. UNIX for Dummies Questions & Answers


I made the fatal mistake of rename the usr directory. I cannot run any commands due to the fact that is in usr/lib/--and it doesn't exist How can I recover my system? (1 Reply)
Discussion started by: SmartJuniorUnix
1 Replies
Login or Register to Ask a Question