How to remove messages coming from UNZIP command?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to remove messages coming from UNZIP command?
# 1  
Old 10-26-2010
How to remove messages coming from UNZIP command?

Hello,
I am writting a script, which gets folder and search for *.zip files in to it.
If .zip files are available, then UNZIP all files into that folder only.
Here is my code,
Code:
for file in "$INPUT_FILE_FOLDER/"*.zip
 do
  unzip -d  "$INPUT_FILE_FOLDER/" -oqq $file
 done

If .zip files are not present into that folder, its showing messages like,
Code:
unzip:  cannot find /data/project/inputfiles/*.zip, /data/project/inputfiles/*.zip.zip or /data/project/inputfiles/*.zip.ZIP.

I do not want these messages to be displayed on my screen.
Could you please help me out in removing these messages from screen?
Which option i need to use and where?
Thanks in advance.

Last edited by Poonamol; 10-26-2010 at 01:57 AM.. Reason: spell check
# 2  
Old 10-26-2010
Quote:
Originally Posted by Poonamol
...
If .zip files are not present into that folder, its showing messages like,
Code:
unzip:  cannot find /data/project/inputfiles/*.zip, /data/project/inputfiles/*.zip.zip or /data/project/inputfiles/*.zip.ZIP.

I do not want these messages to be displayed on my screen.
...
Which option i need to use and where?
...
Add "2 > /dev/null" at the end of the unzip command.

tyler_durden
# 3  
Old 10-26-2010
Thanks for reply. Its working fine now. Smilie Smilie

Last edited by Poonamol; 10-26-2010 at 02:10 AM.. Reason: edit contents
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Top Command Output is not coming via Cronjob

Dear All, I created a small script to get the CPU, GIS usage etc automatically. However when i run this script manually its working , but when i run through cronjob i am not getting any output. Can anyone please help me on this. I am using SuseLinux. Thank you in advance. #!/bin/sh {... (2 Replies)
Discussion started by: Nitin Kapoor
2 Replies

2. UNIX for Advanced & Expert Users

Unzip command

Hi I have a zip file at linux while unziping those files using unzip command in rare scenario it copy the 0 size file to the destination. These files are .so file with their soft link.It is happening for one of .so file. (2 Replies)
Discussion started by: AnkitMogha
2 Replies

3. 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

4. Shell Programming and Scripting

Telnet errors coming on screen while using snarf command.

Hi Team, I am using one script, It is working fine, the problem is it gives unwanted telnet errors when I am using it. I just want to remove these unwanted errors/info from my screen. bash-3.00$ cat raza_site_temp #!/usr/bin/bash #rj835b IFS="|" REGEX="$*" echo snarf2 -c "show... (1 Reply)
Discussion started by: Raza Ali
1 Replies

5. Shell Programming and Scripting

Single command - unzip files from a tar command

I have a tar file that contains multiple .Z files. Hence I need to issue a tar command followed by a gzip command to fully extract the files. How do I do it in a single command? What I'm doing now is tar xvf a.tar (this will output 1.Z and 2.Z) gzip -d *.Z (to extract 1.Z and 2.Z) (9 Replies)
Discussion started by: ericlim
9 Replies

6. Shell Programming and Scripting

unzip command

i want to know how to unzip a archive file by replacing the same folder with file name.. help me or not! :)http://www.unix.com/images/smilies/rolleyes.gif (6 Replies)
Discussion started by: shunan
6 Replies

7. Shell Programming and Scripting

Files are not coming in attachement by any command

Hi All I want to send a file thru a mail with an attachment. i tried using uuencode , but it says "bash: uuencode: command not found" and the same i am getting for mutt as well: "bash: mutt: command not found" Tried searching in all the forums but could not find anything... (2 Replies)
Discussion started by: Prateek007
2 Replies

8. 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

9. 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

10. UNIX for Dummies Questions & Answers

unzip command

The program asks, whether you want to replace, rename, etc., the file before unzipping. Is there any other command which can unzip the Winzip file in unix or any way so that this message will not come. As i have to run it thru the job scheduler. Thanks, Gaurav (1 Reply)
Discussion started by: gammit
1 Replies
Login or Register to Ask a Question