Skip to main content

Questions tagged [perl]

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 graphics programming, system administration, network programming, finance, bioinformatics, and other engineering applications.

1 vote
0 answers
17 views

Problem enabling perl module stream AlmaLinux 8.10

I have an issue with our AlmaLinux 8.10 systems that they suddenly have issues with perl dependancies. It tuns out that the current active perl stream is 5.26 (dnf module list perl*) but some packages ...
Stefan Lelieveld's user avatar
-1 votes
3 answers
90 views

Delete 2-line paragraphs, keep 3-line paragraphs, maintain newline between all

On a Linux machine with GNU tools I have an ascii file that consists of only 2-line and 3-line paragraphs, each paragraph separated by a newline. All 2-line paragraphs are to be deleted so that all 3-...
stampeder's user avatar
0 votes
1 answer
44 views

version `XCRYPT_2.0' not found after Update Debian 10 to Debian 12

I was instructed to upgrade Debian 10 to Debian 12. After the upgrade, I noticed that the ssh.service was not working. Now I found out that no 'apt' commands work. I can't install anything. Here the ...
Szymon Tesmer's user avatar
16 votes
5 answers
1k views

How can UserA programmatically replace a text string within a file they own that's located in /etc?

A non-root linux user owns a text file that's located in /etc, where the non-root linux user does not have permission to create files. The non-root linux user can edit the file manually via vi without ...
Tortoise Pirate's user avatar
0 votes
1 answer
40 views

What does the line ($eachJOBID = $eachScriptNoPath) =~ s/\.csh// ; do?

This line I have in my code cuts the .csh from a string and returns the rest of it. Can someone explain what each part of it does? ($eachJOBID = $eachScriptNoPath) =~ s/\.csh// ;
manylya's user avatar
1 vote
3 answers
73 views

Bash: sum a number present in N lines before a given pattern

I have a kdenlive project file (which is basically a xml file) with a lot of text clips inside. I need to bulk edit the x coordinate of a certain text that appears multiple times. This is an example: ...
baiserekku's user avatar
3 votes
1 answer
472 views

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/...
k.schroeder31's user avatar
1 vote
1 answer
54 views

how to catch output from a subprocess?

I am trying to catch the password prompt of sftp, but somehow it is not from STDIN or STDERR. It possibly comes from a sub-process. The following is my test. I tried to redirect the password prompt to ...
oldpride's user avatar
  • 231
0 votes
1 answer
33 views

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=/...
Thomas's user avatar
  • 23
6 votes
3 answers
644 views

awk: sort by first column then second; output unique 1st column once but all 2nd column

I have a two-column file that you can create as follows cat > twocol << EOF 007 03 001 03 003 01 137 12 001 11 002 01 002 02 002 03 001 02 002 04 137 94 010 21 001 01 EOF The resultant file, ...
bballdave025's user avatar
0 votes
1 answer
71 views

How to combine ...if $x and a here-doc in perl? [closed]

How is one supposed to write this? print <<EOF; if $x bla EOF I think it is called postfix notation, and a here-doc. I get a syntax error. OK, I guess I'll just use print "bla" if $x; ...
Dan Jacobson's user avatar
3 votes
7 answers
434 views

How can I print the longest sequence of lines featuring numbers smaller than a threshold?

I am learning Perl, but I don't know how to solve this problem. I have a .txt file of the following form: 1 16.3346384 2 11.43483 3 1.19819 4 1.1113829 5 1.0953443 6 1.9458343 7 1.345645 8 1....
69 420 1970's user avatar
2 votes
1 answer
25 views

How to use `perldoc` within Emacs (shell)?

While programming using Emacs, you frequently consult manual pages. My environment is text-based Emacs via SSH. While I can open "Normal" manual pages in Emacs using the man command ((man ...
U. Windl's user avatar
  • 1,493
1 vote
1 answer
46 views

Search and replace content

PIN A 1 1:3 0:8 0 0:0 PIN B 1 1:0 0 0:0 Z Z:0 PIN C 1 1:3 0:8 0 0:0 Z Z:0 I would like to change the content on PIN A & PIN C only without affecting PIN B to 0 0:3 Z 0:3 Can't seem to find a ...
JSL's user avatar
  • 11
1 vote
1 answer
51 views

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, ...
Susie's user avatar
  • 13

15 30 50 per page
1
2 3 4 5
91