Tagged Questions
1
vote
1answer
39 views
How to process a file in Perl - handling variables from Bash: disappearing “.” character
I need to find the age of a file in seconds but when I give my Perl line:
perl -e ' my @st=stat("$name"); print time - $st[9];'
a variable from Bash with "." in the filename, it won't find the ...
2
votes
1answer
44 views
Status of perl scripts run from bash scripts
As far as I know we can use $? to get the result of a command we executed and it will return a non-zero result on error and a 0 result on success provided that the programmer kept the convention.
But ...
0
votes
1answer
29 views
Sort specific column and order everything by high number to the low
Won't to order column status by high number to lower.
{"ipaddr":"10.1.2.72","hostname":"qr01034","status":0,"diskusage":"/dev/shm"},
...
0
votes
1answer
59 views
Executing perl script inside bash script
I inherited a long bash script that I recently needed to modify. The bash script is run as a cronjob on a daily basis. I am decent with bash scripting, but I do not know much about Perl.
I had to ...
2
votes
1answer
42 views
Piping to running socat process, But how is this done?
I have a little problem I have the following situation.
I programmed a server tool that already works. No I tried to test it with perl. Therefore I wrote an startscript which is just for starting all ...
1
vote
2answers
54 views
Can I explicitly specify $0 before running a Perl script?
I have a Perl wrapper script, wrapper, which exec's another tool after setting some environment variables. The tools which the wrapper may invoke are symlinked to wrapper, and it dynamically ...
1
vote
3answers
42 views
Perl & Bash : FIND regexp
here's my problem :
I have a perl script that searches some Linux files for me.
File names are like this :
shswitch_751471_126.108.216.254_13121
the problem is that
13121
is an id randomly ...
-1
votes
3answers
89 views
How to modify file's date programmaticaly? [closed]
I have some image files with the wrong date (date of file creation, the value that is shown by ls -l), because it was set wrong in the camera. How can I increment the date by two days in a script ...
-3
votes
4answers
69 views
print specific line if it is matches with the line after it
I have a log file containing the following info:
<msisdn>37495989804</msisdn>
<address>10.14.14.26</address>
<msisdn>37495371855</msisdn>
...
4
votes
2answers
86 views
Why is the STDOUT line printed after the STDERR line?
I completly don't understand this behaviour.
I have a very simple Perl script:
#!/usr/bin/perl
use strict;
use warnings;
print "line 1\n";
print STDERR "line 2\n";
If I run it from console I ...
1
vote
5answers
82 views
Bash script with Perl multi-line regex (OSX)
I have a file containing this XML data:
<?xml version="1.0" encoding="utf-8"?>
<root>
<item>
<tag1>some text</tag1>
...
0
votes
3answers
84 views
replace matches with values from other file
I have a file that consists of many tables that contain data about certain coordinates. Each table is separated by a line with the word "Coords".
Coords
Table 1
Coords
Table 2
Coords
Table 3
...
...
0
votes
0answers
67 views
Language for simple scripting tasks [closed]
After reading many articles on python vs perl, I decided to use python for a simple scripting task which I had previously written in bash script. After tinkering around here and there, I finally came ...
0
votes
2answers
54 views
How to set the shell of remote server through perl telnet
How can I set the remote server shell to bash through the perl telnet?
My code is below:
$telnet = Net::Telnet->new(Timeout=>90,Errmode=>'die');
$telnet->open($ipAddress);
...
2
votes
1answer
72 views
Duplicate photo searching with compare only pure imagedata and image similarity?
Having approximately 600GB of photos collected over 13 years - now stored on freebsd zfs/server.
Photos comes from family computers, from several partial backups to different external USB HDDs, ...