sh: gzip: not found ERROR

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting sh: gzip: not found ERROR
# 1  
Old 06-30-2011
sh: gzip: not found ERROR

I am creating a script to run the SysInfo tool under HPUX servers, this is my script!

# Date: February 29th 2011

#Definicion de variables

> HPUX_SysInfo.log

for host in `cat $PATH_TMP/servers/host_hp2_test`
        echo $DATE >> $PATH_TMP/HPUX_SysInfo.log
        echo sysinfo_segoldt_`date +%Y%m%d`.html >> $PATH_TMP/HPUX_SysInfo.log
        echo "*****************    RUNNING SysInfo in $host   *********************" >> $PATH_TMP/HPUX_SysInfo.log
        ssh $host "SysInfo -H" >> $PATH_TMP/HPUX_SysInfo.log
        echo "*****************    COMPRESSING FILE in $host   *********************" >> $PATH_TMP/HPUX_SysInfo.log
        ssh $host "gzip /tmp/sysinfo_segoldt_`date +%Y%m%d`.html" >> $PATH_TMP/HPUX_SysInfo.log
        echo "*****************    COPYING FILE TO harp   *********************" >> $PATH_TMP/HPUX_SysInfo.log
        scp -p $host:/tmp/sysinfo_segoldt_`date +%Y%m%d`.html.gz $PATH_TMP/servers/HPUX/ >> $PATH_TMP/HPUX_SysInfo.log
        echo "*****************    REMOVING FILE from $host   *********************" >> $PATH_TMP/HPUX_SysInfo.log
        ssh $host "rm -fr /tmp/sysinfo_segoldt*" >> $PATH_TMP/HPUX_SysInfo.log
        echo "----------------------------    DONE    -----------------------------" >> $PATH_TMP/HPUX_SysInfo.log
        echo >> $PATH_TMP/HPUX_SysInfo.log

My problem arises when trying to gzip a file...on my .log file i get this error

sh: gzip: not found

Whenever I execute the commands directly on a server I don't have a problem running any of the commands. Can anyone help me on this.

SysInfo -H outputs this file /tmp/sysinfo_segoldt_20110630.html
# 2  
Old 06-30-2011

Probably not got directory /usr/contrib/bin in $PATH for your job. It's not in the default path. Just specify full path.
This User Gave Thanks to methyl For This Post:
# 3  
Old 06-30-2011
this work out great!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Command not found error 'then'

Could you let me know if my path is having bourne bash echo $PATH /u01/app/oracle/product/10.2.0/db_1/bin:/usr/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/oracle/bin $ which bash /bin/bash $ which ls alias ls='ls --color=tty' /bin/ls Below is... (3 Replies)
Discussion started by: csguna6
3 Replies

2. Shell Programming and Scripting

/bin/sh: : not found error

Hello, When i run the shell script in Solaris, i am getting the below error. /bin/sh: not found I have tried including "#!/bin/bash" , did not work, tried with #!/bin/ksh , did not work, tried without the above include in the script, but still did not work. Please help me to... (5 Replies)
Discussion started by: balareddy
5 Replies

3. Shell Programming and Scripting

command not found error

hello every time i run the following code for val in fileX fileY fileZ do $val=`ls -l $val | awk '{print $5}'` done i got error message command not found , i tried to add ' and " but nothing works its only worked wen remove $val= but i want the name of the file and the value ... (9 Replies)
Discussion started by: mogabr
9 Replies

4. UNIX for Advanced & Expert Users

gzip vs pipe gzip: produce different file size

Hi All, I have a random test file: test.txt, size: 146 $ ll test.txt $ 146 test.txt Take 1: $ cat test.txt | gzip > test.txt.gz $ ll test.txt.gz $ 124 test.txt.gz Take 2: $ gzip test.txt $ ll test.txt.gz $ 133 test.txt.gz As you can see, gzipping a file and piping into gzip... (1 Reply)
Discussion started by: hanfresco
1 Replies

5. Programming

gzip on pipe error handling

Hi all... I have the following code: FILE *fp = popen(" gzip -dc /somemount/somefile.gz", "r"); while(fgets(buffer, 1024, fp)) { some code.... } "/somemount" is a mount of some network drive. Sometimes error occurs in while loop - I can see the following "Input/Output error"... (4 Replies)
Discussion started by: adm1n
4 Replies

6. UNIX for Dummies Questions & Answers

gunzip error - not in gzip format

Hi, I am getting this error gunzip file1.tar.Z gunzip: file1.tar.Z: not in gzip format Any clues? This goes bad only in some recent installations of ids (5 Replies)
Discussion started by: eagercyber
5 Replies

7. AIX

GZIP ERROR! -- Plesae help! -- Urgent

I have two huge files on AIX Ver 5.0. File size of each file is 6238884375 bytes. There is huge difference in sizes when I zip them by gzip coomand. File1.gz 586147513 File2.gz 547585695 Any idea why it is so? Thanks Sumit (2 Replies)
Discussion started by: sumitc
2 Replies

8. UNIX and Linux Applications

gzip: FSUM7351 not found

Hi, I am getting an error while trying to gzip a file in Unix environment. Below given is the error message I am getting. gzip: FSUM7351 not found I could not see the file 'gzip' in /bin root directory. Is this the reason for this? Please help me . (4 Replies)
Discussion started by: bijus76
4 Replies

9. Shell Programming and Scripting

not found error

Hi I have to move data to a file based on the valuies of first three characters in a file I am using the following script FIN=$LOC/TEST.TXT FEEDFILE=$LOC/TUE_GROSSJE.TXT #Read the file while read FDROW do FEEDROW=$FDROW; DTYPE=`echo $FEEDROW |cut -c 1-3` if ; then $FEEDROW... (4 Replies)
Discussion started by: gander_ss
4 Replies

10. Shell Programming and Scripting

An error with gzip

Have an issue with the following snippet of code, in particular the execution of the `gzip -9 ${ARCHIVE_FILE}`. It is failing with a ReturnCode of 1 - Can anyone lead me to a souce that identifies & describes what RC's there are for gzip, as I've not been able to find any. echo '-- TARing up... (1 Reply)
Discussion started by: Cameron
1 Replies
Login or Register to Ask a Question