Sponsored Content
Top Forums Shell Programming and Scripting Unzip file By checking condition. Post 302400330 by vivekraj on Wednesday 3rd of March 2010 02:09:47 AM
Old 03-03-2010
You try the following code.
Code:
 
while read line 
do 
if [[ -e $line ]];then 
mkdir temp 
cp $line temp 
cd temp 
unzip $line 
cd - 
if [[ -n `ls temp | grep .jsp` ]];then 
line1=`ls temp | grep -v ".jsp\|.zip"` 
for i in $line1 do dir=`echo /tmp/``echo $line | cut -d '.' -f 1`
if [[ -d $dir ]]; then 
cp temp/$i $dir 
else 
mkdir $dir 
cp temp/$i $dir 
fi 
done 
fi 
fi 
rm -rf temp 
done < zipfile 
rm -rf temp


Last edited by vivekraj; 03-03-2010 at 03:16 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Condition checking

Dear all That's another problem from me, i wanna do a lot of if statement checking for correct input by user, will be prompt input again if the input not meet the requirement defined by If or while statement... like this one .... while I know it's less effiency write the program... (14 Replies)
Discussion started by: trynew
14 Replies

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

3. Shell Programming and Scripting

Checking condition inside the loop

Hi all, I have one clarification i am using the loop which will process for each record .suppose there is f ailure in the first record it need to send mail and process the next .my code: defcount=`cat <filename>|wc -l` while ] do if <some condiotion> then echo "mail" fi done so... (1 Reply)
Discussion started by: ithirak17
1 Replies

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

5. Shell Programming and Scripting

Cutting specific line of a file by checking condition

testfile.csv 0","1125209",,"689202CBx18888",,"49",,,"NONMC",,,,,"01112010",,,,,,,"MTM- "1","",,"689202ABx19005",,"49",,,"NONMC",,,,,"01072010",,,,,,,"MTM- testfile.csv looks like above format if the second column is null then get 23rd column and store in a different varible .. add all the... (1 Reply)
Discussion started by: mgant
1 Replies

6. Shell Programming and Scripting

create separate file after checking condition..

Problem : I want to create a separate file for country list if condition is true. Please help. ***************************************************** Input file: SV-INCR-139302-365540488-201104090934.sqllog SV-INCR-1082-552793184-201104040805.sqllog SV-INCR-1077-855045741-201104040805.sqllog... (4 Replies)
Discussion started by: humaemo
4 Replies

7. Shell Programming and Scripting

Checking file existence along with condition

Hi am trying to write a script which find the existence of a file from a find command output and perform a task if the file exists. Help me out with the correct syntax . Am trying with the following one but unable to get the output. if then <some tasks> else echo "file not exists" fi (5 Replies)
Discussion started by: rogerben
5 Replies

8. Shell Programming and Scripting

Condition checking in UNIX

i have a script where i have to find the age of a file, if then echo "dnb file is present for the monthly load" >> $RUNLOG dnb="1" else echo "dnb file has not arrived yet" > $ERRLOG dnb="0" fi i know the file is available so... (3 Replies)
Discussion started by: lovelysethii
3 Replies

9. Shell Programming and Scripting

Condition checking issue while if

hi, i am using a simple condition end_ct=`sqlplus -s $ORACLE_USER/$ORACLE_PASS@$ORACLE_SID << EOF select description from bravo_statistics where trunc(time_stamp)=trunc(sysdate)-1 and description='END CAT'; EOF` echo $end_ct; echo... (30 Replies)
Discussion started by: lovelysethii
30 Replies

10. 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
REDSHIFT(5)							 REDSHIFT.CONF(5)						       REDSHIFT(5)

NAME
redshift.conf - configuration file for redshift and gtk-redshift DESCRIPTION
A configuration file with the name `redshift.conf' can optionally be placed in `~/.config/'. The file has standard INI format. General pro- gram options are placed under the `redshift' header, while options for location providers and adjustment methods are placed under a header with the name of that provider or method. General options are: temp-day = integer Daytime temperature temp-night = integer Night temperature transition = 0 or 1 Disable or enable transitions brightness-day = 0.1-1.0 Screen brightness at daytime brightness-night = 0.1-1.0 Screen brightness at night gamma = R:G:B Gamma adjustment to apply adjustment-method = name Select adjustment method. Options for the adjustment method can be given under the configuration file heading of the same name. location-provider = name Select location provider. Options for the location provider can be given under the configuration file heading of the same name. Options for location providers and adjustment methods can be found in the help output of the providers and methods. EXAMPLE
Example for Copenhagen, Denmark: $ redshift -l 55.7:12.6 -t 5700:3600 -g 0.8 -m vidmode -v An example configuration file with the same effect as the above command line: [redshift] temp-day=5700 temp-night=3600 gamma=0.8 adjustment-method=vidmode location-provider=manual AUTHOR
redshift was written by Martin Koelewijn and Jon Lund Steffensen. This manual page was created by Franziska Lichtblau <rhalina@old-forest.org> for the Debian project (and may be used by others). redshift 1.7 June 2012 REDSHIFT(5)
All times are GMT -4. The time now is 08:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy