Sponsored Content
Top Forums Shell Programming and Scripting Do not find the mistake in a small routine!!! Post 302514205 by jurgen on Friday 15th of April 2011 05:26:51 AM
Old 04-15-2011
the remove list are variables.For example:
remove_list='_12345_ '
- this line should be removed in the old_list.txt
home/user/..../20110414/XXX_12345_20110414.txt,50.4......


Regards
Jurgen

---------- Post updated at 04:26 AM ---------- Previous update was at 04:15 AM ----------

Quote:
Originally Posted by mirni
useless use of echo. You can do without. Bigger problem is in the redirection. You are overwriting your updated_list at every run of sed.
Use in-place editing instead:
Code:
remoremove_list='_12345_ _54321_ _2468_ _abcde_'
cp old_list updated_list
for delete in $remove_list ;  do   
     sed -i "/$delete/d" updated_list
   done

Its working if I use "sed -e" instead of "sed -i"
One additional question...how can I use also the remove list to delete the corresponding files...
Something like that

Code:
cd $directory
for i in HLF_TF_*.txt
do 
   rm $remove_list
done

THANKS VERY MUCH FOR THE HELP

Last edited by jurgen; 04-15-2011 at 06:38 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Directory find in small and capitals

I've a very trivial thing bothering me. I'm rather new in scripting so I'll keep asking stupid questions. Here is small script that does backup of mails. --- for i in `cat /maildir.dir` do echo $i maildir=`echo $i|sed 's@^./usr/@@'` for j in $i/* do && { st="`find $j/backup -name "*"... (3 Replies)
Discussion started by: nitin
3 Replies

2. UNIX for Dummies Questions & Answers

Crontab Mistake!!!

Hi. I hope someone can help me with this problem. Being a novice to Unix, I editted my crontab directly by typing " crontab -e ". Well, I needed to make some changes so, I typed " crontab -r ". Now I have no crontab, and I can't seem to get crontab to write a new file. I' ve tried: vi... (4 Replies)
Discussion started by: cstovall
4 Replies

3. Shell Programming and Scripting

sub routine call

in windows machine... C:\2\test>perl -version This is perl, v5.6.1 built for MSWin32-x86-multi-thread (with 1 registered patch, see perl -V for more detail) ------------------------------------------ what is the difference b\w subroutine calls: sub_routine_name("-----"); and ... (2 Replies)
Discussion started by: sekar sundaram
2 Replies

4. AIX

Did a Mistake with HACMP

Hi, I needed space on a FS, and when I've added the space on the filesystem, I did it trough the regular smitty fs inteface and not with smitty cl_lvm. Can someone help me to repair the situat before a faileover happen ? Thanks for your help,:mad: (13 Replies)
Discussion started by: azzed27
13 Replies

5. Shell Programming and Scripting

Can't find the mistake in sed expression

Hi there, Can anyone help me find the correct expression for sed. I want to repace iface eth0 inet wathever with iface eth0 inet static Thanks for your help Santiago (5 Replies)
Discussion started by: chebarbudo
5 Replies

6. Shell Programming and Scripting

awk routine help

Hi, I use awk but not as a programming language. Just generally in piplelines to split things out by fields. I am trying to accomplish this one thing that I think a short awk routine would do great for, but can't figure it out. Lets say I have a file that contains database columns. The file... (25 Replies)
Discussion started by: fwellers
25 Replies

7. Shell Programming and Scripting

Is there any mistake in this code:

cat $1 | sort -n | uniq | $1 in other words, I sort the content of the file and put the ouput in the same file, is there any mistakes in this cshell code ??? (4 Replies)
Discussion started by: Takeeshe
4 Replies

8. UNIX for Dummies Questions & Answers

Probably some stupid mistake...

Hi everyone ! I have a file wich look like this : >Sis01 > Sis02 ... >Sis44 I want to separe each paragraphe in a different file, so I decide to use the "FOR" loop + sed. for f in {01..44} do (5 Replies)
Discussion started by: sluvah
5 Replies

9. Shell Programming and Scripting

Can anyone find the mistake in this script file

#!/bin/ksh db_user=`echo $DB_USER_NAME` db_pwd=`echo $DB_PASSWORD` db_sid=`echo $TWO_TASK` sqlplus -s $db_user/$db_pwd@$db_sid << EOF a = select ACK_PARTY_NAME,bus_event_seq_nbr from bus_event where ack_party_name like 'MOVE_USAGE_DAEMON%' and bus_event_seq_nbr='3969094' set -- echo $a |... (17 Replies)
Discussion started by: rkrish
17 Replies

10. Shell Programming and Scripting

Find words containing small letters

Hello, I have a file containing different words. How can i print the words which contain at least one small letter, for example if i have: today TOMORROw 12345 123a next preViou5 no it should print the following: today TOMORROw 123a next preViou5 no Please use code tags as required... (5 Replies)
Discussion started by: JhonTheNewbie
5 Replies
exdata(3alleg4) 						  Allegro manual						   exdata(3alleg4)

NAME
exdata - Accessing the contents of datafiles. Allegro game programming library. SYNOPSIS
#include <allegro.h> Example exdata DESCRIPTION
This program demonstrates how to access the contents of an Allegro datafile (created by the grabber utility). The example loads the file `example.dat', then blits a bitmap and shows a font, both from this datafile. SEE ALSO
DATAFILE(3alleg4), END_OF_MAIN(3alleg4), allegro_error(3alleg4), allegro_init(3alleg4), allegro_message(3alleg4), blit(3alleg4), font(3alleg4), install_keyboard(3alleg4), load_datafile(3alleg4), makecol(3alleg4), readkey(3alleg4), replace_filename(3alleg4), screen(3alleg4), set_color_conversion(3alleg4), set_gfx_mode(3alleg4), set_palette(3alleg4), textout_ex(3alleg4), unload_datafile(3alleg4) Allegro version 4.4.2 exdata(3alleg4)
All times are GMT -4. The time now is 08:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy