perl

Why is one process ps command showing spaces around a directory instead of slashes?

Why is one process ps command showing spaces around a directory instead of slashes? I’m trying to debug a failing legacy process monitor that searches processes that are running. I determined it is being caused by some mysterious linux behavior. The process being ran is /opt/my/path/directoryname/daemonname but for some odd reason, it shows up with …

Total answers: 1

AWStats stuck, but no output on strace: How to debug?

AWStats stuck, but no output on strace: How to debug? A Perl script is stuck, root 1317478 99.8 0.0 264072 22516 ? R 04:57 478:37 /usr/bin/perl /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=domain.tld-http -staticlinks -configdir=/usr/local/psa/etc/awstats -output=keywords but when I strace -f -p, I only get the output strace: Process 1317478 attached [ Process PID=1317478 runs in x32 mode. ] What’s …

Total answers: 1

Dependency is not satisfiable: libgtk2-perl

Dependency is not satisfiable: libgtk2-perl I am trying to install gmusicbrowser in ubuntu 22.04 but sadly I am getting the below errors. I have sudo apt install libglib2.0-dev in a blind hope it might install perl, but no such luck. sudo gdebi /mnt/nas/Downloads/gmusicbrowser_1.1.16_all.deb Reading package lists… Done Building dependency tree… Done Reading state information… Done …

Total answers: 1

preint and postrm scripts are not running showing as access denied

preint and postrm scripts are not running showing as access denied root@XXXXXXXXXX:/home/user# apt install /var/cache/apt/archives/perl_5.36.0-7 ubuntu0.23.04.2_amd64.deb Reading package lists… Done Building dependency tree… Done Reading state information… Done Note, selecting ‘perl’ instead of ‘/var/cache/apt/archives/perl_5.36.0-7ubuntu0.23. 04.2_amd64.deb’ The following additional packages will be installed: perl-base Suggested packages: perl-doc libterm-readline-gnu-perl | libterm-readline-perl-perl libtap-harness-archive-perl The following packages will be …

Total answers: 1

Report sed changes + corresponding perl syntax

Report sed changes + corresponding perl syntax Newbie learning Linux and perl: I would like to (a) search-replace strings, (b) match filename pattern .myfile., (c) look recursively in subdirectories, and (d) print the line number, file name, original line and changed line. I am looking for the two versions using sed and in perl syntax. …

Total answers: 1

Find all lines between two patterns, EXCLUSIVE of the second pattern?

Find all lines between two patterns, EXCLUSIVE of the second pattern? Consider that I have the file listed below. I need to select all lines from every instance of the regex pattern Word A to before the regex pattern Word D. Word A Word B Word C Word D Word E Word F Word G …

Total answers: 7

Ist it possible to check the peer address before accepting a TCP connection?

Ist it possible to check the peer address before accepting a TCP connection? I wrote a simple Perl server that listens on a TCP port/socket, accepting connections. Now I wonder: When wanting to implement address-based access control, is it possible to check the address of the peer requesting a connection before accepting it? If possible …

Total answers: 4

bash + how to verify folders under specific path are ended with number/s

bash + how to verify folders under specific path are ended with number/s I want to check the folder/s under /var/kafka that all them are ended with number otherwhile I will exit with error ls -ltr /var/kafka drwxr-xr-x 399 kafka kafka 28672 Nov 9 13:10 data6 drwxr-xr-x 392 kafka kafka 28672 Nov 9 13:10 data5 …

Total answers: 3

rename – move [ ] delimited part of filename to end of filename

rename – move [ ] delimited part of filename to end of filename I’ve been playing with the perl implementation of the rename tool in cygwin having finally got it working via installing from cpan. It’s been a long time since i played with this stuff so I’m a bit rusty with my regexp stuff. …

Total answers: 2

Replace new lines at end for those lines whose 2nd field in colon separated file span over to multiple line

Replace new lines at end for those lines whose 2nd field in colon separated file span over to multiple line I have got multiple files with different set of contents but the pattern is same across mulitple lines in different files. sample input file : cat -n test.txt 1 adjfkhjdhfkjd: dfkjfkdljgklfjgklfjgkfjghk 2 rtueitjrkldngfmdn: kldfjkdjgkdjgkldjgkfjhklfjkkjhkgjhklfk 3 …

Total answers: 3

int seems to be not int in a used perl library

int seems to be not int in a used perl library A peculiar phenomenon is on my mind. As you may know, dealing with a mail server directly exposed to the internet can be quite the ‘joy’ with various individuals attempting to break into it or use it as a relay. I don’t have any …

Total answers: 1

Perl: change in interpretation of shell symbols in system() invocation?

Perl: change in interpretation of shell symbols in system() invocation? Today I noticed that something changed in Perl, probably recently, in the way it runs shell commands. Could someone explain what has changed? I cannot find the answer myself and sadly we learned about this change in a hardest way possible. Some new users got …

Total answers: 3

perl: replace a string with variable containing new lines (line breaks)

perl: replace a string with variable containing new lines (line breaks) I want to make edits containing meta characters. Here https://stackoverflow.com/questions/29613304/is-it-possible-to-escape-regex-metacharacters-reliably-with-sed one of solutions is via perl with sQ … E (near end of accepted answer). It is mentioned it handles multi-liners, but: echo ‘a-b’ > a.txt;from=’-‘;to=’n’;perl -s -0777 -pe ‘s/Q$fromE/$to/’ — -from="$from" -to="$to" a.txt …

Total answers: 2

Moving 3 pics randomly to another directory

Moving 3 pics randomly to another directory I am using Linux and I’m in a folder it has 10 .jpg images I want to move 3 pictures only without selection by name or size for example my folder is /sdcard /DCIM/camera/ I want 3 pictures from it to /sdcard using a Linux command it’s possible? …

Total answers: 1

awk add a column if it doesn't exist

awk add a column if it doesn't exist I would like to add a column 3 (description) if it does not exist in a ‘;’ delimited file. example; #Gene;Transcripts;Description;Group gene1;G1a,G1b,G1c;gene1 is a good gene;6 gene2;G2a,G2b,G2c;gene2 is a funny gene;3 gene3;G3a,G3b;4 gene4;G4a;gene4 description;5 gene5;G5a,G5b;6 Expected output #Gene;Transcripts;Description;Group gene1;G1a,G1b,G1c;gene1 is a good gene;6 gene2;G2a,G2b,G2c;gene2 is a funny …

Total answers: 4

Renaming files in Linux using perl scripting

Renaming files in Linux using perl scripting I have a set of files with prefix, say "pre_", on a Linux machine and I just want to rename all of these files by removing that. Here is the perl code I wrote it doesn’t throw any errors, but the work is not done. #!/usr/bin/perl -w my …

Total answers: 3

Error installing perl BerkeleyDB module

Error installing perl BerkeleyDB module I’m trying to install a program which has various perl dependencies. One of the perl dependencies (BerkeleyDB) fails during install. I know very little about perl. Is there a way for me (as a user) to solve this? Is there a SPAN command to try earlier versions? cpan[49]> install BerkeleyDB …

Total answers: 1