Re: Need Help with making a bash script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



For your first problem:

today=`date "#+%d%m%Y"`
while read  ipaddr 
do
echo "$ipaddr REJECT $today"
done < blacklist_file > /tmp/new_file$$
mv  /tmp/new_file$$  blacklist_file

On Fri, May 28, 2004 at 05:36:49PM -0400, Fernando wrote:
> I have two problems.
> 
> 
> 1. I'm making a script to add IP's to my blacklist...
> 
> I need to add three <tabs>, the word 'REJECT' and a #DDMMYYYY that it's 
> being done to a text file that has the IP's in it... ie this is the 
> original list;
> 
> 80.25.148.216
> 80.43.197.197
> 
> needs to end up like this...
> 
> 80.25.148.216            REJECT    #28052004
> 80.43.197.197            REJECT    #28052004
> 
> 
> 
> 2. The second is a little bit more complicated.

--
Rudy Vener
-
: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Newbie]     [Audio]     [Hams]     [Kernel Newbies]     [Util Linux NG]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Device Drivers]     [Samba]     [Video 4 Linux]     [Git]     [Fedora Users]

  Powered by Linux