0
votes
1answer
36 views

Trying to split a very large file into multiple smaller files based on the contents of each record (perl/linux)

Here is the problem. I have 20 very large files, each approx 10gb, and I need to split each of the bulk files by A) criteria within the record and B) what type of bulk file it is. Example. Each ...
0
votes
0answers
15 views

rrdtool graph one line on different color

I'm using RRDtool to create graphs. I wanted to create a graph of wind direction. Something like this: http://obrazki.elektroda.pl/5023134600_1335016575.jpg Wind speed chart has a different color ...
2
votes
3answers
47 views

Multiple filter on line and reorder line

My title is a bit confusing because I don't know how to express it in good english. Here's my issue. I'm having a flat file formatted this way: : name1 field1-1: field2:value1-2 field3:"value1-3" ...
-5
votes
2answers
68 views

Add zero value in a file if there is no value [closed]

I have a select query which fetches all the orders for a particular hour(sorry i will copy the db2 query later) and result will be stored in sample.txt file The output will like below, sample.txt ...
0
votes
1answer
56 views

Search in directory of files based on keywords from another file

Perl Newbie here and looking for some help. I have a directory of files and a "keywords" file which has the attributes to search for and the attribute type. For example: Keywords.txt Attribute1 ...
-2
votes
1answer
46 views

Perl & Linux? : Make a log reader script run daily and weekly (automatic) [closed]

We have a Log reader script, for example: use strict; use warnings; my $location = "file.txt"; open LOGFILE, $location; my $first_line = 1; my $max_id; while (<LOGFILE>) { if ...
3
votes
1answer
74 views

Bash script to tail -f with colored lines

I tried to create a script from this suggestion like this : #!/bin/bash if [ $# -eq 0 ]; then tail -f /var/log/mylog.log fi if [ $# -eq 1 ]; then tail -f /var/log/mylog.log | perl ...
0
votes
4answers
43 views

How to escape additional empty line while parsing pairwise data in Perl

I have an input file that looks like this: >Seq_1;1 AAAAAAAAAAAAAAAAAAAAA >Seq_2;1 CCCCCCCCCCCCCCCCCCCCC And there are many more pairwise line like that. What I want to do is to simply print ...
3
votes
3answers
61 views

Linux command to layout tab separated list nicely

I would like to generate a log file with tab separated columns. It should have the following format with tab separated output for all but the comment field time date alias comment ...
0
votes
3answers
47 views

How to read 2 files and print matched pattern?

I am trying to read 2 files and trying to print matched pattern in both files. It is not working. Can someone point me where I am doing wrong? #!/usr/bin/perl open (FILE1, 'Dimension.csv'); my ...
-1
votes
1answer
86 views

Reading a file line-by-line fork/exec - Perl

Currently I'm attempting to read a file line by line and fork processes using perl Basically my perl script "test.pl" executes another script using exec the way it should work is the script "run.sh" ...
1
vote
0answers
43 views

Books for designing Command line Interfaces/Interpreters [closed]

I am planning to write a CLI in perl, for creating a text editor more like with capabilities of editing with tools like awk, sed, etc. I found some modules in CPAN like App::Cmd, MooseX::Getopt, ...
1
vote
1answer
31 views

Git (1.8.1.2) error when adding interactively

Attempting a git add -i resulted in the following error: Can't locate Error.pm in @INC (@INC contains: /usr/share/perl/5.14.2 /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 ...
0
votes
1answer
22 views

Perl script use of gpg vs. CLI gpg?

As part of a perl script, I am downloading some files from a website based on cycle numbers obtained from emails. I use a regexp to find the appropriate cycle number, append that to a url and grab an ...
2
votes
2answers
52 views

perl $filename vs. ./$filename in SUSE Linux Enterprise

Student intern working on school's Linux system, back with another question. For background, please read this question: (How to test an HTTP header value using LWP::UserAgent). I have made more ...
-2
votes
1answer
71 views

Perl Comparison

I'm creating a script in Perl that will takes photos from a camera and check to see if any new pictures have been taken. In Ubuntu I'm using gphoto2 to search the camera for the pictures then ...
0
votes
1answer
45 views

linux print variable vaule in foreach loop a1,a2,a3

I have a an old csh script (which hopefully I have time to rewrite in perl) which has a series of variables wmr1, wmr2 ... wmr24. What I would like to do is echo the values of each variable using a ...
0
votes
2answers
42 views

how to uninstall perl on linux

I just installed perl on linux referring to http://learn.perl.org/installing/unix_linux.html by the command : curl -L http://xrl.us/installperlnix | bash Does anyone know how to remove the perl? ...
0
votes
1answer
42 views

Perl Compile Error - make: [pod/perltoc.pod] Segmentation fault

I have a Qnap NAS TS-119 PII with an ARM processor. I need a newer Perl version as ipkg offers. I want to install Perl from the source. The Configure command works great: ./Configure -Dcc=gcc ...
-1
votes
0answers
59 views

How to tar list of files without directory structure. Files which are added to tar must be removed from the folder [closed]

Hi i am new to perl/shell. How to tar list of files without directory structure. Files which are added to tar must be removed from the folder. I am using the below code snippet to add files to tar, ...
0
votes
1answer
57 views

I installed a perl module via cpan. But how do i use it?

After lot's of issues I managed to get cpan to work in cygwin. I did: cpan[2]> i Log::Log4perl and it seemed to work. I.e. it downloaded something: cpan[2]> i Log::Log4perl Fetching with ...
0
votes
1answer
57 views

Changing the font size of terminal output in perl

How does one change the font size of terminal output created via the print command in perl? The output font color and emphasis (e.g., bold) can be changed by using functionality provided by the ...
0
votes
1answer
119 views

Perl cannot locate module in @INC

I am running Centos 6.4 and perl 5.10. I have short script which uses the DateTime module. However when I run my script I get the following error message telling me various modules cannot be located ...
1
vote
1answer
65 views

DBD::Pg::st execute failed: ERROR: syntax error at or near “$1”

Trying to set a value in PostgreSQL using Perl and DBI, and thus DBD::Pg. I'm getting an odd error. 2013-05-23 19:02:36.641139500 updating status to 0 2013-05-23 19:02:36.641410500 DBD::Pg::st ...
-1
votes
2answers
80 views

Simple Perl program to print the time to nano resolution to screen

If I run Date +%H:%M:%S.%N from a linux bash command-line it prints out the time to nanosecond resolution. I am trying to continuously print that to the screen but this perl program doesn't seem to ...
0
votes
0answers
56 views

how to escape asterisk/glob when sending command to linux host

i've written a script which takes the contents of a hostfile and a cmdlist, logs into each host in turn and executes each command in cmdfile then returns the output. a typical session might look like ...
1
vote
2answers
56 views

How to detect if my server is running centos or other from a perl script

I want to display some text in a script only if the Operating System is Centos . How can i do that in a perl script ?
0
votes
0answers
52 views

two subdirectories named 'sys' under /usr/lib64/perl5 [closed]

Anybody's got an idea why there are two subdirectories named 'sys' under /usr/lib64/perl5 ? Different inodes, but anyway... Here's the output (Fedora18): ls -li /usr/lib64/perl5/ [...] ...
1
vote
1answer
55 views

What is the smart way for start parallel tasks in forked proccess via perl, linux and anyevent?

I have an issue with AnyEvent::Utils::fork_call. I m using fork_call, then doing some work, and after that i should end my fork_call, and start new parallel task. I tried that: fork_call { # ...
0
votes
1answer
75 views

Recursively listing the contents of a tar/zip archive

I understand how to get contents of zip/tar files, for example: http://www.if-not-true-then-false.com/2010/list-tar-tar-gz-tar-bz2-contents/ But in my case: I want to get all contents of a zip ...
0
votes
1answer
67 views

Parsing the output of SGE's (qstat -j “*”) using AWK or Perl

I have the output from SGE qstat command that looks like this: http://dpaste.com/1177012/plain/ It is obtained with the following command: $ qstat -j "*" What I want to do is to parse the ...
1
vote
0answers
102 views

Joining MP3s “perfectly” [closed]

I have a bunch of small MP3 files that complement each other into a song. I want to join them into one big file. It seems that avconv (ffmpeg) does a good job: avconv -i "concat:1.mp3|2.mp3|3.mp3" ...
7
votes
1answer
111 views

Edit linux capabilities in Perl

In a C program, you can edit your capabilities with cap_set_proc from libcap. How can I achieve the same in a Perl program?
3
votes
2answers
98 views

Send TERM signal to child process spawned in another thread of parent process

I'm on Linux platform and using Perl. First of all I created a thread, and forked a child process in this new thread. When the parent in the new thread returned and joined to the main thread, I would ...
-1
votes
0answers
51 views

Have a server play a sound when it receives an email [closed]

There's a server sitting in my room, and I would like it to play a sound whenever I receive a specific email (let's just say, for example, the emails that notify me I have a new follower on twitter). ...
0
votes
1answer
52 views

Comparing and displaying hash values

I am able to print all of the lines from /etc/passwd by UID and username. I would like to compare the values of UID and display corresponding usernames by <150 and >150. this is my while loop ...
0
votes
2answers
67 views

How to print file content in parts to the screen?

I am trying to store command output into a file (that works fine) and then what I want to do, is to display the file content to the screen. My problem is that I want it to be displayed in parts (for ...
0
votes
3answers
116 views

Optimize shell script (bash) to impove performance

I have a bash script which I use to process a text file: #/bin/bash dos2unix sourcefile.txt cat sourcefile.txt | grep -v '\/' | grep -v '\-\-' | grep -v '#' | grep '[A-Za-z]\*' > ...
0
votes
2answers
49 views

Tab based split on lines misses empty columns - Perl

I have a tab separated text file. I read line by line and column by column. I make few changes in each column and write the line to a new file. When I read each column using split function of perl ...
-2
votes
0answers
24 views

read pm files present in linux machines from windows machines, through perl script [closed]

i need to grep for some pattern in perl files present in Linux machines from my windows command prompt. can this be possible ? if yes, how ? Thanks in advance.
2
votes
2answers
42 views

Perl Directory Finder doesn't work?

I have a script to find Directories and .tar.gz Files. For whatever reason (that's what I'm hoping you can help me with) my if ( -d $file ) doesn't return that it's a directory!!! My Script: # ...
0
votes
2answers
44 views

Glob is different value error opening a file and reading

sub open_files { my @files = @_; my @lines; foreach (@files){ print "$_\[1\]\n"; } foreach my $f (@files){ print "$f\[2\]\n"; open(my $fh,'<',$f) or ...
5
votes
1answer
71 views

Why does glob lstat matching entries?

Looking into behavior in this question, I was surprised to see that perl lstat()s every path matching a glob pattern: $ mkdir dir $ touch dir/{foo,bar,baz}.txt $ strace -e trace=lstat perl -E 'say ...
0
votes
2answers
77 views

Perl one liner + regular expression to match part of word

I write Perl one liner code in order to match IP address according to the following rule: match only the three first octets while the four octet must be valid 0-255 , additional to that number or "." ...
2
votes
3answers
109 views

Need to modify several XML files with Perl script in Linux env

I have several XML files named TC_Circle1, TC_Circle2, TC_Point1, etc in a directory and I want to use a script to update the start and stop dates in each file. The start and stop dates are inside ...
0
votes
2answers
48 views

Running awk on file, with regular expressions

I would like to find all occurrences of INPUT in a file, JUST INPUT. I have the following, but it finds everything with INPUT* awk '{for(i=1;i<=NF;i++){if($i~/^INPUT/){print $i}}}' I would like ...
1
vote
3answers
107 views

how to merge two files consistently line by line

I have two files (file1.txt & file2.txt ) , files are only examples . How to merge the two files , in order to create the file - merge_files.txt as example 3 I writing now ksh script , so merge ...
1
vote
2answers
115 views

Busy box, Run C, python or Perl programs

All I have is bourne shell and busy box. Is there any way to run a python script or compile a c program or any languages like perl .. like busybox python eatmemory.py 100M or busybox gcc ...
1
vote
2answers
47 views

Does file content fully exist in library files

I have just completed the refactoring of a long piece of code. My refactoring included breaking up the source code into many functions in many files at many folders. Now that I'm done, I want to ...
0
votes
2answers
79 views

perl + add warn massage in perl one liner code

I have perl one liner code that rename the names of files/directories code: find /tmp -name "*$NAME_THAT_WE_WANT_TO_CHANGE*" -exec /tmp/rename.pl ...

1 2 3 4 5 17
15 30 50 per page