The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Regarding Shell Scripting anilkarikkandar UNIX for Dummies Questions & Answers 3 11-20-2006 12:26 AM
HELP PLS!! Shell Scripting!! Mary_xxx Shell Programming and Scripting 9 09-16-2006 07:52 AM
difference between AIX shell scripting and Unix shell scripting. haroonec Shell Programming and Scripting 2 04-12-2006 09:12 AM
something else on shell scripting master_6ez Shell Programming and Scripting 1 11-21-2004 11:42 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-26-2007
raghav1982 raghav1982 is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 101
Help need in Shell Scripting

Hi All

i am writing a shell which would read from a parameter file , and once the file is read it should not display those lines in the output file

Example

Prameter file is b.txt and it contains the following :
aaaa
cccc
ffffff
rrrrrr
qqqq

and i issue the command df -d it will display all the datas and store it in a log file , but those lines which are mentioned should not be there in the log file
can anyone help me on this
  #2 (permalink)  
Old 11-26-2007
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,960
something like this,


Code:
awk 'BEGIN{ while ( getline < "parameter.file" ) { arr[$0]++ } }{ if ( !( $0 in arr ) ) { print } }' data.file

  #3 (permalink)  
Old 11-26-2007
raghav1982 raghav1982 is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 101
one quick question : data.file which is mentioned is the output log file which is generated ?

Thanks

  #4 (permalink)  
Old 11-26-2007
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,960
Quote:
Originally Posted by raghav1982 View Post
one quick question : data.file which is mentioned is the output log file which is generated ?

Thanks

exactly

and the paramter.file is the "b.txt"
  #5 (permalink)  
Old 11-27-2007
raghav1982 raghav1982 is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 101
Smile

Hi , Thanks fo you help

I am rewritting the requirement once again

i am executing a command autorep -j % and redirecting the ouput to one file

autorep -j % -q > data1.txt

data1.txt has all the information which is avaiable in the database

and have a parameter file which has these lines (b.txt)
qqqqq
aaaa
asss
assddd
454545

Once i run the shell script with the command included

autorep -j % -q > data1.txt , it should read from the parameter file and should produce another output data2.txt , and those ouput should not have the lines which are in b.txt

Can anyone help me on this !!

Thanks once again
  #6 (permalink)  
Old 11-27-2007
grial's Avatar
grial grial is offline Forum Advisor  
El UNIX es como un toro
  
 

Join Date: Jun 2006
Location: Madrid (Spain)
Posts: 531
The script code may help us... Could you post it?
  #7 (permalink)  
Old 12-02-2007
lishannx lishannx is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 5
then how do yuu make the password invisible in a particular file?
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:28 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0