Perl is a high-level, general-purpose, interpreted, dynamic programming language. It was originally developed by Larry Wall as a general-purpose Unix scripting language to make report processing easier, over a period with support from open source community, it has evolved and matured to be used for ...
1
vote
1answer
34 views
Perl dependency issue
I've installed CentOS 6.3 (i386) recently.
It has two perl binary
/usr/bin/perl (v5.10.1)
/usr/local/appx/perl/bin/perl (v5.8.8)
My question: Is it possible to install some other funtinonality ...
5
votes
2answers
153 views
Special character '#' in Perl SSH command
I try to send command using SSH in my perl script with # but it gets truncated right at #
Example:
Input text is :
$message = "Product ID # STK000134"
The SSH command is :
$execute=`ssh -q ...
5
votes
4answers
158 views
How to remove multiple blank lines from a file?
I have some text-files I use to take notes in - just plain text, usually just using cat >> file. Occasionally I use a blank line or two (just return - the new-line character) to specify a new ...
1
vote
1answer
27 views
Trimming one part if equal to another part?
I use an e-mail quote attribution string like this:
On dd mmm yyyy hh:mm +hhmm, from [email protected] (Example Dot Org):
where [email protected] is the sender's e-mail address and Example Dot Org is ...
0
votes
2answers
79 views
Reordering strings in linux
How can I change lines around using the command line?
e.g. I have these lines:
Acct-Status-Type = Start
User-Name = "37XXXXXXX"
Event-Timestamp = "Apr 12 2013 15:56:55 AMT"
I need to ...
4
votes
3answers
94 views
Delete XML node containing certain element
I want to remove all Placemarks from a KML file that contain the element <tessellate>. The following block should be wholly removed:
<Placemark>
...
-1
votes
3answers
55 views
Sorting IP address according to the second field in file
in my ksh script I need to add the following task ( OS - linux/solaris )
I have the following file
more test.txt
/etc/backup/app 172.1.120 172.110.120
/etc/backup/app 172.1.120.12 ...
0
votes
1answer
36 views
read line by line and take a string in line and assign that string to the subsequent line using perl
Data file is fixed length file, and I want to read file line by line and take a string from the current line, and then append that string to the subsequent line and write into another file.
For ...
-4
votes
1answer
44 views
How to transform two delimited ASCII files
These are 2 common delimited, text file transformation problems I'd like to find scripts to do (I dont know if awk or perl is best for these tasks).
csh is the default shell on my Solaris10 unix ...
0
votes
3answers
41 views
Grep end regex matching
On OS X, system_profiler SPHardwareDataType outputs:
Hardware Overview:
Model Name: MacBook Pro
Total Number of Cores: 4
L2 Cache (per Core): 256 KB
L3 Cache: 8 MB
Memory: 8 GB
I want to ...
1
vote
3answers
156 views
awk, sed, grep, perl… which to print out in this case?
I have this syntax in a file (http response times from analog):
<thead><tr><th class="x">seconds</th><th class="R">reqs</th><th ...
10
votes
3answers
330 views
What does ${1+“$@”} mean in a shell script, and how does it differ from “$@”?
In the Perl documentation, perlrun(1) suggests launching Perl scripts using a bilingual shell/Perl header:
#!/bin/sh
#! -*-perl-*-
eval 'exec perl -x -wS $0 ${1+"$@"}'
if 0;
What does ${1+"$@"} ...
0
votes
2answers
64 views
perl one liner + print VALUE in the end of the line
The following perl one liner checks if $CURRENT_VERSION matches $NEW_VERSION exactly, and prints it if it does.
Example:
CURRENT_VERSION=223.3.12.4.5.3
NEW_VERSION=223.3.12.4.5.3
DATE=17.3.2013
...
2
votes
1answer
70 views
perl + combine exec command with perl one liner line
I have the following short perl script rename.pl. How can I translate this script to one liner perl syntax? And how to combine the perl one liner in find command?
rename.pl
#!/usr/bin/perl
$op = ...
0
votes
1answer
174 views
Rename files and directories with a special characters on solaris machines
The target of the following code ( commands ) is to rename files/directories and also support files/directories with a special characters as "@" or "." etc
those commands are run fine on Linux ...