-2
votes
1answer
643 views

convert CSV to XLS file on linux [closed]

The following Perl script can convert CSV file to XLS file the problem is that I need to install on customer Linux machine many Perl modules in order to run this Perl script , and actually I cant ...
1
vote
5answers
44 views

df -k + how to match the root volume line

please advise how to match the "/" volume from df -k command? I tried the following: [root@machine /]# df -k | grep "/" /dev/vx/dsk/bootdg/rootvol 130926685 71378710 58238709 56% / /devices ...
0
votes
0answers
35 views

Folding in vimrc does not work as expected

I added these to my vimrc: set foldenable set foldmethod=syntax set foldlevelstart=1 let javaScript_fold=1 " JavaScript let perl_fold=1 " Perl let php_folding=1 ...
0
votes
0answers
90 views

Unable to install Crypt::SSLeay perl module on RHEL 5.7 (x86_64)

Here is the scenario, actually my RHEL 5.7 (x64_86) server don't have internet connection. but I want to install Crypt::SSLeay perl module on that server. So I downloaded it from CPAN & then ...
0
votes
2answers
237 views

how to remove all double quotes from csv except specific field

I want to remove all double quotes from my csv but not the fourth field (because the four fields represent PATH of file) Please advice how to implement this by sed or awk or perl one liner , etc ...
1
vote
1answer
80 views

Using kornshell or Perl to circumvent permissions needed by root

I have a problem where I need to change the ownership and permissions of one file that exists on more than 200 servers. I belong to 2 different groups and need to change the ownership from one group ...
0
votes
3answers
82 views

remove new lines

My input is a csv file like this: 10,"Special Projects,bangaram",0,,0 10,"Statutory/ Internal Audit , MO reporting (incl Excel Spreadsheet uploadation) ", bangaram,0,,0 10,"Complience with ...
0
votes
2answers
338 views

perl one liners + match word and delete string after separator

I work with linux/solaris machines and I need to add some rule in my ksh script: Please advise how to match the password word in file, and delete the value password after the separator "=" with perl ...
0
votes
3answers
162 views

Shell attempts to interpret Perl script in spite of correct shebang [closed]

I have looked through the forums and I can't seem to find how to fix this. I have a very simple perl code that works fine on Windows, but when I try it on Linux and Solaris I get the following errors: ...
0
votes
1answer
472 views

how to install Padre in linux(CentOS)?

How to install Padre IDE tool in Linux(Centos) for Perl scripting language?
1
vote
1answer
234 views

how to subtract a constant value from a data file?

I want to subtract a constant number from my data to get new data file. For example, I want to subtract 10 from my data. data.txt Id a b c d e 1 1 2 3 4 5 2 2 3 4 5 6 ...
1
vote
3answers
251 views

How to calculate the sum of the data that have the same ID in the first column?

I want to sum the values of the rows of my data that have the same ID in the first column. My data looks like data.txt Id a b c d e 1 1 2 3 4 5 1 2 3 4 5 ...
0
votes
2answers
110 views

How to Lookup the values of an index values from a big data file?

I have a data file (data_array.txt in the example) and index file, index.txt, at which I want to extract the data from the data file that have the same ID in the index file and store in to a new file, ...
0
votes
1answer
38 views

rearranging from colum to row in a csv [duplicate]

I have a CSV file that presently has an output like this 1 2 3 4 5 what I need to do is reconfigure the output as follows 1 2 3 4 5 all the entry data on one line, any help would be greatly ...
0
votes
3answers
144 views

Count words: what will use less CPU, wc or a perl script?

My objective is to count the words in a file while using the minimum possible CPU. I could use the wc command or write a simple perl script for this, which of the two options will be less CPU ...
1
vote
1answer
86 views

How to mention rpm to look for dependent perl modules in the system

By default rpm looks for the perl modules inside the rpm itself and throws dependency error if it is not found. For eg., I have a perl script in the rpm that uses Crypt::DES perl module. I have that ...
1
vote
1answer
129 views

Why wouldn't Perl CGI script run

I'm using Apache on CentOS and am trying to run a Perl CGI script as directory index so it will run automatically as a subdomain. I added DirectoryIndex script.cgi and added a Directory stanza noting ...
2
votes
1answer
264 views

how to replace IP address on remote host using expect

I wrote the following expect script in order to replace the IP address on remote Linux machine I use a perl one-liner for this task I get errors about can't read "HOME": no such variable , Please ...
1
vote
1answer
568 views

How to filter an array of strings in ksh

Please advise what's wrong in my ksh code. I want to remove the IP's as defined in "bb" array from "aa" array so the IP's 255.0.0.0 and 255.255.255.0 will be removed from the list in aa array. When ...
2
votes
2answers
147 views

ksh + delete number from string

the string IP include some IP address numbers as the following example echo ${IP[*]} 192.9.200.1 192.9.200.2 192.9.200.3 is it possible to remove some IP address number from the list ( using ksh ...
1
vote
2answers
291 views

perl one liner + how to match IP address that located in the first/sec field of file

the following perl one liner syntax verify if IP address in "$IP" match the IP ADDRESS in file perl -ne 'BEGIN{$IP=shift} print if /(^|\s)\Q$IP\E(\s|$)/;' $IP file file have two fields as the ...
2
votes
2answers
156 views

linux & solaris - separate netmask IP's from ordinary IP's

I have file with IP address and netmask IP's my target is to cut the netmask IP's from the file_with_IPs.txt and paste them to another file as file_with_only_netmask_ips.txt remark - netmask IP can ...
-3
votes
4answers
663 views

perl one liner + how to replace any last IP address octets

How to replace any last IP address octets (four octet ) to 0 remark: Implementation should be by Perl one linear on linux machines for example 192.9.200.124 will replaced to 192.9.200.0 ...
1
vote
1answer
192 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 ...
0
votes
3answers
447 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
2answers
104 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
240 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 = ...
1
vote
2answers
106 views

renaming a directory and its subdirs without affecting their files

I have to rename directories under the root directory with prefix "ms_PF" and then rename their subdirectories with the modified name of the main directory with an extra "_", and then copy all ...
0
votes
2answers
1k views

Failed dependencies trying to install package 'libxml2'

I am trying to install libxml2, but my system complains about dependencies. The dependent packages exist on system. The ultimate goal is to install xml_grep2, I have been trying various methods ...
2
votes
1answer
95 views

How to list all present optical drivers?

How can I list all the installed optical drivers with udev or any other core-based tool (perl is also very good) ? P.S.: I know about the wodim --devices command, but it's an undesirable ...
1
vote
1answer
722 views

Identify text/ascii files in Linux/Solaris

I have a little project to build bash script that search in the OS ( Linux/Solaris ) the current IP address from files and replace them with other IP address. The problem is that IP address could be ...
1
vote
1answer
598 views

Linux + replace STRING/WORD in file according to rule

My target is to replace any word/string/Any characters in file with new word/string according to the following rules: If numeric characters on the left side of word/string then we not replace the ...
0
votes
1answer
405 views

linux + perl + replace any WORD in file with special characters with condition

Example1 work fine when I want to replace OLD_TEXT with NEW_TEXT ( its replace also all special characters as $@^%)(_+`:; etc ..) example1 export OLD_TEXT='$$OLD_WORD$$' export ...
2
votes
4answers
1k views

Replace all but a set of characters in a file with newline

how to delete all characters in file except numbers and "." , each word (numbers/dot) should be in new line in file see example2 the solution can be with sed or awk or ksh syntax remark - ...
2
votes
2answers
2k views

Fetch values from plist file on Linux

I have bash script which was written for OS X and now ported to Linux. I don't have access to the Linux box. The bash script would read values from plist files using the defaults read and PlistBuddy ...
10
votes
4answers
1k views

Why is Perl installed by default with most Linux distributions?

Just curious. The title says it all: Why is Perl installed by default with most Linux distributions?
-2
votes
3answers
751 views

how to check for disk in use on rhel

How to check if a disk is in use? If in use, How to check free, used space before I can start using it? I'm trying this in Perl and Any help is appreciated.
9
votes
2answers
5k views

How to know reason of a process going to sleep state and wake it up?

When I do 'top' , I see my perl script process in 'S' state. Is there a way to know, what is making this perl process go in sleep state and ways to wake it up? Any way to debug to give more insights ...
0
votes
2answers
485 views

Need to install MySQL Client libaries but RPM not installing them

I'm trying install the MySQL Client libraries for the Perl Mod of the same name but when I run sudo rpm --install -v --allfiles MySQL-client-5.5.16-1.linux2.6.i386.rpm and querying the rpm ...
2
votes
2answers
288 views

perl regex replacing globally when global not selected

I'm using Ubuntu 11.04 and wrote a small script that searches within text files for certain "tokens" and replaces with some a prewritten snippet from a template file of the same name. The text files ...
1
vote
1answer
695 views

Find server with small ping latency (my script, but can anyone write it in e.g.: Perl?) [closed]

I want to download OpenBSD with FTP with a script, and I want to download it from a server that is near me. So I want to choose a mirror that has low "ping latency". I wrote a little script, that ...
1
vote
2answers
263 views

Perl find and replace is writing every file

Here's the test script I'm running matt@server:~ $ cat test.sh #!/bin/bash mkdir test cd test echo "has the string foo" > yes.txt echo "hasn't the string" > no.txt ls -l --time-style=full-iso ...