10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have an inherited perl script that extracts the first three octets of an IP Address using a combination of split() against a dot and then builds it all back together again, its a whole block of code to do this
I wondered if anyone had a one liner in their arsenal to extract the first... (7 Replies)
Discussion started by: hcclnoodles
2. Shell Programming and Scripting
Greetings fellow scripters.
I find myself editing multiple files, sometimes with the same bits of information. My bash script, a changelog, and a plist file (OS X). Once I realized this, I thought why not script part of this process (and so it begins). In any case, I've solved several of the... (1 Reply)
Discussion started by: reid
3. Shell Programming and Scripting
I need a Perl one liner which prints a newline into a .txt file, only where the line starts with "/mediawiki-1.19.0/". It should add the newline to the line before.
My problem is, when I try to realize this (with my little knowledge :rolleyes: ) i come to the point where the // are... (4 Replies)
Discussion started by: Mr.Smith
4. UNIX for Dummies Questions & Answers
Not quite a unix question but problem in a perl command. Taking a chance if someone knows about the error
a b c d
perl -p -e 's/a/b/g' 1
b b c d
What is the problem here??
perl -p -i -e 's/a/b/g' 1
Can't remove 1: Text file busy, skipping file. (2 Replies)
Discussion started by: analyst
5. Shell Programming and Scripting
I want to replace awk with a perl one liner in unix.
i use in awk REGEX and FS ( field separator) because
awk syntaxes in different unix os versions have not the same behaviour.
Awk, Nawk and GNU Awk Cheat Sheet - good coders code, great reuse
i have a file named "file" and want... (5 Replies)
Discussion started by: bora99
6. Shell Programming and Scripting
can someone help me translate the following command, from:
/usr/bin/awk "/^$TOFDAYM $TOFDAYD /,0" $LOGFILE
to something like
perl -e .....
basically, i want to use perl to do awk functions within a shell script. i want to do the above awk, using perl.
any suggestions? (9 Replies)
Discussion started by: SkySmart
7. Shell Programming and Scripting
Thanks for giving your time and effort to answer questions and helping newbies like me understand awk.
I have a huge file, millions of lines, so perl takes quite a bit of time, I'd like to convert these perl one liners to awk.
Basically I'd like all lines with ISA sandwiched between... (9 Replies)
Discussion started by: verge
8. Shell Programming and Scripting
In a ~4GB file there are lines like,
188.8.131.52 Googe.com - Jan/23/2011:00:00:00 +0000 "URL Google HTTP/1.1" 45 56 208 - "http://www.gogle.com/webhp?hl=en&tab=nw#hl=en&source=hp&biw=1366&bih=667&q=hello&aq=f&aqi=&aql=&oq=&fp=c432485467934a89" ".Net; Fox" -
184.108.40.206 Goge.com -... (3 Replies)
Discussion started by: gameboy87
9. Shell Programming and Scripting
Can anybody explain how this perl one liner works..
It is to test whether the number is prime or not
perl -le 'print "PRIME" if (1 x shift) !~ /^(11+)\1+$/' 19
Thanks in advance
Shihab (2 Replies)
Discussion started by: shihabvk
10. Shell Programming and Scripting
I'm writing a script to automate some post-install tasks on RHEL4 servers.
I need the following code to insert an 'A' in the middle of a string, then replace the string in a file. I know I can use sed to do this, but I'd like to use perl's in place edit so I don't have to write to a temp file,... (1 Reply)
Discussion started by: Xek