Skip to main content

All Questions

Tagged with
3 votes
1 answer
108 views

OpenSSH session is killed when from Perl a syswrite call is made with an empty variable in Solaris 11

We have a strange problem in Solaris 11.4. The problem arise when a code as the following is run from Perl my $emptystring = ""; syswrite STDOUT, $emptystring; The execution of a syswrite ...
Ciges's user avatar
  • 131
-1 votes
1 answer
604 views

Need a sed or perl command to replace line that starts with certain text

I am looking for either sed or perl command to find a line in a file on multiple servers that begins with certain text and then replace the entire line. These lines will always start with the same ...
Cameron's user avatar
0 votes
1 answer
382 views

Missing module for Perl running in Solaris 5.10

I've created a perl script that fetch string/s and output as a file to be loaded on our database. Now, i'm using Solaris 5.10 to run the perl script but there's an error and i think it's referring ...
Ace's user avatar
  • 65
1 vote
1 answer
500 views

Equivalent of "ssh-keyscan -H" in Solaris 10/11

I'm creating a Perl program that adds the specified host in root's known_hosts file. The program works in AIX and Linux, but not in Solaris and sadly, I can't find its equivalent command. Sample line:...
Shan's user avatar
  • 11
0 votes
3 answers
2k views

how to print only Difference in two files using NR=FNR?

we have to print the old entries only Delta(Difference) in File-1 and File-2. newly added enties in files-1 no need to print. on my unix server everyday new report is extracted from system which is ...
Sachin Radkar's user avatar
1 vote
2 answers
208 views

get command line perl command to report what changes it's made

I am using the following command (on Solaris) to remove the protocol from a bunch of files. find . -name "*.txt" -exec perl -pi -e 's/http//g' '{}' \; Is there a way to have a verbose output so I ...
user2609641's user avatar
2 votes
2 answers
4k views

remove ^M from solaris by perl one liner on the same file

usually in order to remove the ^M from file we do dos2unix test.txt test.txt tr -d '\r' < old.file > new.file but this approach insist to create new file if we do not want to create another ...
maihabunash's user avatar
  • 7,181
0 votes
2 answers
2k 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 ...
user avatar
0 votes
3 answers
3k 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: ...
user974873's user avatar
1 vote
2 answers
950 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 ...
yael's user avatar
  • 1,325
2 votes
2 answers
388 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 ...
yael's user avatar
  • 1,325
-3 votes
4 answers
3k 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 ...
yael's user avatar
  • 1,325
0 votes
2 answers
2k views

Perl - /etc/shadow - Permission Denied

The following command is being executed by a non root user : perl -pi -e 's/^an24:/an24:\*LK*/g' /etc/shadow A permission denied is being issued. This indicates some privileges issues. Can such ...
oneway's user avatar
  • 51
2 votes
1 answer
1k 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 = ...
yael's user avatar
  • 1,325
0 votes
1 answer
2k views

Rename files and directories with a special characters on solaris machines

The target of the following code ( commands ) is to rename files/directories and also support files/directories with a special characters as "@" or "." etc those commands are run fine on Linux ...
yael's user avatar
  • 1,325

15 30 50 per page