Help need in Shell Scripting

Hi All :slight_smile:

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

something like this,

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

one quick question : data.file which is mentioned is the output log file which is generated ?

Thanks

:slight_smile:

exactly

and the paramter.file is the "b.txt"

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

The script code may help us... Could you post it?

Hi , not started the code

autorep -j e% -q will display all the jobs in the database

i am redirecting it to an output file

autorep -j e% -q > data1.txt

i have another parameter file b.txt
qqqq
aaaa
3333
454545

once i execute the shell it has to collect all the information using autorep command , and then read from the parameter file b.txt and my final output should have all info other than the names which are mentioned in b.txt

can i get any sample code how to proceed on this
Thankyou!!

I'm afraid I misunderstood yout first post, I'm sorry :slight_smile:
OK, what about this? (not tested):

autorep -j e% -q > data1.txt
PATTERNTMP=
while read l; do
   PATTERNTMP="${PATTERNTMP}|$l"
done < b.txt
PATTERN=$(echo $PATTERN | sed 's/^|//')
grep -v -E "${PATTERN}" data1.txt

Regards.

Hi
grep: RE error 41: No remembered search string. is the error ,

Thanks

then how do yuu make the password invisible in a particular file?

operating system? shell and version?

Is there a problem if you do this:

I think most unix systems have fgrep so should be ok.

HTH.