unzip in script using rsh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting unzip in script using rsh
# 1  
Old 08-07-2006
unzip in script using rsh

Hi
I have searched usr/bin and usr/sbin to try to find unzip but I cannot find it.

My script is using the ksh #!/usr/bin/ksh but when I rsh to another box it cannot find unzip to unzip to a new archive, but I can unzip files when I am using a telnet session on the box.

The error message returned is ksh: unzip: not found
Any ideas?

Thanks

here is my code
Code:
#!usr/bin/ksh
host=dougall
filedir=/home/testing/performance

datefile=`date +%d%m%y%H%M`
rcp -p TEST.zip $host:$filedir
rsh $host "cd $filedir; unzip TEST.zip -d $datefile; cd $filedir/$datefile"

# 2  
Old 08-07-2006
do 'which unzip' on a local system to find the path
# 3  
Old 08-07-2006
cool vergsh99 thank you
I have another question....
the location is on my path ($PATH) and the rsh $PATH why therefore do I need to put the whole path in my rsh commands?
thank you
# 4  
Old 08-07-2006
Quote:
Originally Posted by speedieB
cool vergsh99 thank you
I have another question....
the location is on my path ($PATH) and the rsh $PATH why therefore do I need to put the whole path in my rsh commands?
thank you
....'cause your '$PATH' is local to the SOURCE machine - not to the machine you're rsh-ing to [TARGET]
# 5  
Old 08-07-2006
remote shell uses a minimal PATH on the remote box, usually something like what my box does:
Code:
/usr/bin:/usr/ccs/bin:/usr/bin/X11:/usr/contrib/bin:/usr/local/bin

Plus it invokes /usr/bin/sh not usr/bin/ksh... see the man page for details.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Unzip the .zip file without using unzip utility in UNIX

I have .zip file, i want to list all the files archived in the zip file. unzip utility is not working for me in unix. Please help me resolve this issue Thanks ganesh. (3 Replies)
Discussion started by: Ganesh L
3 Replies

2. Shell Programming and Scripting

Using Shell Script in place of Perl script to Unzip the zip files.

Hi Expert, We have some shell scripts which Internally uses Perl Script to Unzip the source zip files which comes to inbound directory. So now our requirement is to avoid the dependency on Perl Script and us Shell Script to unzip the files. I have the Perl script with me attached can some one... (3 Replies)
Discussion started by: naveen.dasu
3 Replies

3. Shell Programming and Scripting

Help with creating recursive unzip script

Hello. I am trying to create a script that recursively looks at my folder structure, and extracts any .7z files that have not already been extracted yet. I know that all .7z files only have a single .txt file in them, and the only .txt file in any directory would be from that .7z file. I am... (3 Replies)
Discussion started by: Davinator
3 Replies

4. Shell Programming and Scripting

Unzip in bash script

My script works like this. 1. First for loop - checks if it can access zip parameters in a directory 2. If unzip fails for any of the file in that directory, then it goes inside the second for loop - to list which file is that 3. My doubt is..Is there any way I can tell status for every 5000... (17 Replies)
Discussion started by: vidhyamirra
17 Replies

5. Shell Programming and Scripting

How to Unzip a file using unzip utility for files zipped without zip utility ?

Hi, I need to zip/compress a data file and send to a vendor. The vendor does have only unzip utility and can accept only .ZIP files. I do not have zip utility in my server. How do I zip/compress the file so that it can be deflated using unzip command ? I tried gzip & compress commands, but... (1 Reply)
Discussion started by: Sabari Nath S
1 Replies

6. Shell Programming and Scripting

How to Unzip a .ZIP file in Unix without using unzip cmd..?????

Hi All I have ftped a .ZIP file (zipped using WinZip in Windows) to my Unix server (HP-UX). I don't have unzip cmd available in my curent Unix version Please let me know any cmd in UNIX (other than unzip) using which I can unzip this .ZIP file . Please elaborate on the commands aval and... (5 Replies)
Discussion started by: sureshg_sampat
5 Replies

7. Shell Programming and Scripting

SFTP / UNZIP script issues

Hi everyone, i'm having a little trouble wih my first shell script ever. So the point of that script is to: -Archive Zip files in a directory -Remove txt files from that directory -connect through sftp and a rsa key to a remote server -download a couple of files -unzip downloaded files ... (0 Replies)
Discussion started by: Peanutz
0 Replies

8. Shell Programming and Scripting

Script to unzip specific files

As part of an audit at work I need to review a lot of Windows workstations. One thing I need to do is review all of the .doc files. My problem is that I guessed a number of these files would be in zip archives. This is the case but they are mixed in with a lot of other file types that I am not... (1 Reply)
Discussion started by: stumpyuk
1 Replies

9. Shell Programming and Scripting

Shell script for unzip

All, I'm having 4 .zip files that are coming from FTP. I need to unzip those files and put that files into another folder. Can anyone help me how to write a shell script to check wether .zip files are located in FTP folder, if condition true then how to unzip and put it in another folder. Thanks in... (2 Replies)
Discussion started by: nvkuriseti
2 Replies

10. HP-UX

How to Unzip a .ZIP file in Unix without using unzip cmd..?????

Hi All I have ftped a .ZIP file (zipped using WinZip in Windows) to my Unix server (HP-UX). I don't have unzip cmd available in my curent Unix version Please let me know any cmd in UNIX (other than unzip) using which I can unzip this .ZIP file . Please elaborate on the commands aval and... (5 Replies)
Discussion started by: sureshg_sampat
5 Replies
Login or Register to Ask a Question