General :: Perl Script To Suppress Matches From Two Text Lists?
Dec 23, 2010
Referencing a previous thread in which a similar problem exists:[URL]Currently I am using grep -ivf a.txt b.txt > c.txt to get what I need.
a.txt:
user1@domain.com
uSer2@domain.com
[code]....
View 1 Replies
ADVERTISEMENT
Sep 2, 2010
I have been using comm to compare two simple column lists, and suppress items that were contained in the second list (suppression list). This was extremely simple and basic, however now list1 has two columns, and I must compare the second column in list1 with my suppression list.
Basically I need to compare my user list and suppression list to suppress any users that exist in the suppression list, then remove the second column (md5).I wasn't sure the fastest way to make comparisons if there was a similar command like comm, or if I needed to create an array of users and see if any of them matched the suppression list one by one. This seemed like it would be pretty process intensive. Anyone have any less cumbersome ideas?
View 6 Replies
View Related
Jan 25, 2011
Im creating a perl script that will be sending out mail to mailing-lists, but im not getting it to work. Its no problem getting the script to send mail to regular mail addresses, but it doesnt seem to handle to send mail to mailing lists. Im using the Net::SMTP perl module.how to send mail from a perl script to a mailing list (and not just regular mail addresses) ?
View 2 Replies
View Related
Apr 12, 2010
I am trying to create a shell script, on taking a input file as parameter, which need to do 3 things
1) create a copy of existing file.
2) add a new line to the copied file.
3) strip off all the absolute paths inside the copied file
The first 2 points are straight forward. but i am finding it difficult to acheive the 3rd point. myself not very good with awk and sed. but gave it a shot in vain. For example, the input script consists of below,
PROGRAM=`/usr/bin/basename $0`
HOST=`/usr/bin/uname -n`
echo Start $PROGRAM `/usr/bin/date` |
/usr/bin/tee -a $LOG
The output of the script should look like,
PROGRAM=`basename $0`
HOST=`uname -n`
echo Start $PROGRAM `date` |
tee -a $LOG
View 14 Replies
View Related
Jun 21, 2010
on creating a new perl script which replace IP address from the text file. eg. If in a file, we found any word like 11.222.333.44 then it has to be replaced to XX.XXX.333.44
View 8 Replies
View Related
Feb 22, 2011
I need to get names of all installed packages in 2 machines and save them in 2 text files, then I want to compare these 2 files to know the differences between 2 files and from that I could know the differences between 2 machines. Is it possible to do that and what program I could use?
View 2 Replies
View Related
Mar 8, 2011
Firstly i'd like to introduce myself before I ask my question, i am currently studying a "Network Operating System 2" course, and in the syllabus the professor decided to use Ubuntu Linux for us. This is a first for me and I am truly greatly interested in the OS. It seems like a solid system once you get to know the deep foundations of it. The professor has already given us an assignment, but I feel its not fair as its just a bit too much from out of what he taught us .. He did not teach us what he is asking for. He asked us to create to a text file which lists the Sales from two Salespersons, and each one will have an amount for each month .. So 12 entries for each salesperson.
Using that text file, we should write a bash script which would read the values from the above text file, and produce a "Monthly Sales" text file, which shows the total sales of each month (combined from both the salespersons). I would like to ask for some guidance, some help on how to start. It's just that he didn't teach us any commands about this matter.
View 9 Replies
View Related
Mar 6, 2011
I have a few problem. I have txt file like this:Quote:00 21 55 84 9a ff 00 1f 9e 1a 5b 00 08 00 45 00 00 4b 00 00 40 00 3f 11 9a 0e a1 8b fa 02 04 02Then, based on my txt file, I would like to generate text like this:Quote:00215584 2155849a 55849aff 849aff00 9aff001f ff001f9e 001f9e1a 1f9e1a5b 9e1a5b00 1a5b0008 5b000800 00080045 08004500 00450000 00004b00 004b0000 4b000040 00004000 0040003f 40003f11 003f119a 3f119a0e 119a0ea1 9a0ea18b 0ea18bfa a18bfa02ased in my reading, I found about ngram solution in perlbut I not really understand to edit from source code given. I m begineer user in programming language. I hope to get the solution. [URL]
View 1 Replies
View Related
Jun 21, 2010
How can I delete rows into text file in perl?
View 4 Replies
View Related
Apr 8, 2010
I've been trying to figure out a way to more easily color text in Perl like I do on Bash on a Linux box. In bash, what I'll do is set color variables up to equal the escape sequence, then echo out with escape seqeunces to print it exactly how I want it. Typically I'll want a character or a word in a different color, not the whole line. For example
echo -n -e "My face is turning ${RED}red${UNCOLOR} like a lobster." In Perl with the term::ANSIColor module, it seems to just do a line. Am I being dense? Is there a way that I can do it like I do it in BASH that's fairly easy to read after the fact?
View 11 Replies
View Related
Jul 1, 2010
I need a loop that pulls out the user name into a variable and then pulls out the LastUpdate field into another variable so I can then perform a comparison against the last update field. Requirements are AIX tools including AWK, SED and Perl I am writing a script to check AIX users password expiration dates and if they are within the alerting period (ie. 7 days etc) it will email the user. I will release the full script into the public domain once completed. The text file I want to parse is formatted like:
Code:
colettel:
password = XSON0m4SdIQDw
lastupdate = 1260829398
andrewwa:
[code].....
View 4 Replies
View Related
May 11, 2011
Using rsync, which switch will allow rsync to suppress the "skipping non-regular file" messages in the output while still being reasonably verbose for everything else?
View 1 Replies
View Related
Feb 27, 2010
How to suppress "Do you want to overwrite" prompt while using cp command. I tried "cp -fr", but it isn't worked
View 4 Replies
View Related
Jul 22, 2010
In gcc, does anyone know how to suppress a particular warning. I want to suppress "warning: useless storage class specifier in empty declaration"
View 6 Replies
View Related
Jun 9, 2010
I am looking for some source package which will convert plain text file to html file without using perl.
I mainly need to do this on an ARM platform, so if I get sources I can cross compile it.
View 5 Replies
View Related
Apr 1, 2009
Was wondering if any perl guru's could help me with a quick log file adjustment. I have a text file that looks like so (tabs and newlines are revealed so you can see what separates the data):
There are maybe 100 lines of text in this file at any given time. I need to delete all duplicate lines only looking at the first bit of text prior to the first tab. It doesn't matter which one gets deleted as long as there are no two lines that begin with that same text at the beginning before the first tab. So in this example, either the fist line "1234" or the last line "1234" would need to be deleted. I already have code in my script that opens the files - I just need the code to read the text into an array and the part that would find matches based on the above criteria, and make the deletions.
If it would be easier, I can even do a system call and use SED (v4.1.5) and/or AWK (3.1.5) instead.
View 7 Replies
View Related
Apr 27, 2010
I'm running Ubuntu Server 9.10 and every time that I su in as root and run a command, I get a little message after saying:
"You have mail in /var/mail/root"
And in fact, I do have mail in there, it's mail that I would like to keep for future reference. How can I suppress the message though?
View 1 Replies
View Related
Jul 12, 2010
I am trying to write a Perl script that can open a file, find text that appears between two identifying strings (for now, "start" and "end"), then modify that text by enclosing it between "term_" and "_term" . Since the identified strings vary, the replacement string becomes "term_$1_term". From looking at other threads in this forum I've been able to get as far as spitting out the modified terms using the following code:
open FILE, "start2.txt" || die ("Could not open file <br> $!");
$text = <FILE>;
while ($text=~ s/start (.*?) end//) {
[code]....
The problem is how to get "term_$1_term" into the file in the same while loop, which I'm guessing would be some of variant of "$text=~ s/$1/$term/;" (which doesn't work as it stands).
View 6 Replies
View Related
Oct 4, 2010
rpm -qa --last lists all rpm with date and time. But I want to sort the list by date, with earlier rpm displayed first. So it needs pipe, rpm -qa --last |
View 2 Replies
View Related
Feb 9, 2010
I'm getting 10000000's of syslog messages :
"eth0: PHY reset until link up"
- I have wireless and don't normally use an ethernet cable. From Googling round I found this bug report https://bugs.launchpad.net/ubuntu/+s...ux/+bug/270184 which appears to match the problem, however I do not feel happy/competent enough to recompile the driver as suggested in the bug fix. Is there a way to configure the driver so that it only tries the eth0 connection a limited number of times? This is Ubuntu 8.04 2.4.26-27 and SIS 191 chipset
View 4 Replies
View Related
Mar 3, 2011
does any linux admins out there have any mailing lists that they subscribe to? I go to lots of sites for knowledge but i was trying to put together the double whammy and pull together a solid mailing list for linux admins as well.
View 6 Replies
View Related
Dec 17, 2010
I have a small problem with Perl and Apache.
If I use "#!/usr/bin/perl" in the beginning of a perl script the script won't work if the script is at all complicated. Simple scripts like "Hello World" works.
But if I use "#!/usr/bin/perl -w" in the beginning all scripts work?
If I don't use the -w this is whats in the logs:
(2)No such file or directory: exec of '/home/test.net/html/cgi-bin/uh/meny.pl' failed
Premature end of script headers: meny.pl
When I use the -w in the script the error-log shows me this.
meny.pl: Name "main::http_path_cgi" used only once: possible typo at /home/test.net/html/cgi-bin/uh/meny.pl line 24.
View 1 Replies
View Related
Feb 12, 2010
Amarok is nice, and currently the only thing I've tried that will actually play audio from network shares and not lock up. Only problem is that it doesn't seem to list my library by directory/folder structure.. only album/artist/genre or some variation thereof. Is there anything that does list by folder structure?
View 3 Replies
View Related
Feb 7, 2011
Which commands lists your outstanding print jobs?
View 3 Replies
View Related
Jan 30, 2011
how to create a mailing list using the 'newlist' command in /var/local/mailman/. I sucessfully create the list and i receive a confirmation message but after adding members to the list, none of them receives mail sent to list.
View 1 Replies
View Related
Sep 5, 2010
My question is probably better explained by example; I have two files that look like this:
Code:
$ cat file1.txt
mercury
venus
earth
mars
[Code]....
The general stipulations are as you'd expect; both files are of an arbitrary length, generally file1 will be larger than file2 but this is not guaranteed, the common lines (if any) will always be contiguous and only occur at the end of file1 and the start of file2.
View 14 Replies
View Related
Aug 21, 2011
I've got a setup where I need to use 'find' to find 0 or more files in a certain directory, however, 'find' always produces an error when there are no files that match a certain check. Is it possible to run 'find' while having it omit errors when no files match the pattern?
View 2 Replies
View Related
Feb 4, 2010
After upgrade from MDV 2009.1 to MDV 2010 a bunch of available kernels that can be selected are listed at boot. I think that these are still installed but I really don't need them listed. I would like to get rid of the list of extras. I've had a look at /boot/grub but I can't figure out what.
View 11 Replies
View Related
Nov 24, 2010
Let me begin by saying that I'm a "casual user" of my computer (I'm a retiree who uses her 'machine' for email, looking up mostly useless info, & pretending to be a writer). However, migraines from beating my head on the keyboard in frustration over Windows eccentricities led me straight to Linux. Linux blows windows out of the water, IMO.
Except for Media Players. I have tried every one in Ubuntu's software catalog. Rhythmbox is the only one that works, & it doesn't work correctly. I use my computer as my primary music source, & have saved nearly 200 albums/CDs to it. I transferred my collection to a memory stick, then tried to transfer it to Ubuntu. Rhythmbox 'accepted' most but not all albums, but none of the downloaded music, & lists the songs in each album backwards. When I open an album, sometimes Rhythmbox plays them backwards, sometimes (rarely) 'frontwards', but usually, jumps around, plays a few of the numbers, then stops. Occasionally, it goes through the collection, playing one song from each collection.
I was able to transfer the entire collection to 'Listen' media player, but it doesn't actually play anything, & I never even got that far with any other player. I have a two year-old HP Compaq Presario desktop w/ 500GB, (300 to Ubuntu & the rest to The Dreaded Windows for some stuff I can't run on Linux). I began with running Ubuntu 10.04 on 'wubi', then installed it from a CD I burned from the Ubuntu site. Someone suggested I had screwed something up during downloading, so I got 10.04 on a CD (w/ "Ubuntu for Non-Geeks"), but had the same media player problems. Last month I upgraded to 10.10, but still have the same problems.
View 9 Replies
View Related
Aug 11, 2010
I am new here and want to lern CentOS. Current I have installed CentOS 5.5 x64 and Perl 5.8.8. Now i have install Perl 5.12.1 which located to /usr/local/bin/perl. But how I can move it to /usr/bin/perl so root based on Perl 5.12.1?
View 7 Replies
View Related