Skip to main content

All Questions

Tagged with
-1 votes
3 answers
218 views

Mapping readings with labels [closed]

Given a list of readings in the following format: 1 1 0 0 2 3 23101 23101 0 0 2 0 5 2 0 0 1 1 0 0 2 2 23104 23104 0 0 1 0 5 1 0 0 What would be an approriate (and clean !) way to map them to their ...
Little Code's user avatar
0 votes
1 answer
2k views

Perl script not found when executed from a different directory than the current one

I am using perl64 on Windows 10 with UWIN installed. I wrote a perl script, sv2jb.pl, which runs fine when invoked under ksh by just typing its name, and when it is in the current directory. I then ...
MichaelParis's user avatar
1 vote
1 answer
574 views

Unix Solaris script for executing commands in multiple remote hosts

I have two hosts for eg. 1) 00.00.00.01 having regions on diffrent ports for eg. a) a1region (port 0011) b) b1region (port 0012) c) c1region (port 0013) 2) 00.00.00.02 having regions on diffrent ...
Nilchoud's user avatar
3 votes
1 answer
2k views

SFTP Dual Factor Authentication

My Issue I am trying to automate a file fetch from an external [SFTP] server. The server is using 2-factor authentication. First, it needs a public-private key pairing established [This has already ...
onejerlo's user avatar
2 votes
2 answers
6k views

Script that only counts Established, TIME_WAIT, and Closed Wait connections using Netstat

I'm trying to make a script (using Perl, but it isn't necessary) that will only count the number of Established, Time_Wait, and Closed_Wait connections on a system and print them in terminal. So far I'...
monkeychef's user avatar
1 vote
4 answers
527 views

How to insert a variable in a variable in a random place?

Q: How can I insert variable $b to a truly random place in variable $a? Example INPUT variable content: $ echo $a árvíztűrő tükörfúrógép $ echo $b ZZ OUTPUT $ ./somemagicscript.sh árvíztűrő ...
user avatar
2 votes
4 answers
1k views

How to highlight given string in given place?

How can we modify this: <a href="http://foo.bar1">asfdlksafbar1qsasadf</a><br> <a href="http://foo.bar2">svasfbar2saldkfj</a><br> <a href="http://foo.bar3">...
user avatar
3 votes
5 answers
448 views

Get values block by block in same file

I have a file say "SAMPLE.txt" with following content, P1 10,9:6/123456 P2 blah blah P1 10,9:5/98765 P2 blah blah P1 blah blah P2 I want a output file say "RESULT.txt" as, Value1:123456 Value2:...
Garvit Khandelwal's user avatar
1 vote
1 answer
455 views

Using kornshell or Perl to circumvent permissions needed by root

I have a problem where I need to change the ownership and permissions of one file that exists on more than 200 servers. I belong to 2 different groups and need to change the ownership from one group ...
etho201's user avatar
  • 317
1 vote
3 answers
6k views

Print the last-but-one field

How to print the word before the last word in line (with ksh or awk or sed or perl one liner) Example 1: echo one two three will print "two" Example 2: echo 1 2 3 4 5 6 will print "5"
user avatar
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
1 answer
2k views

perl one liners + print line if match last word but with space

The following perl syntax will print the line in case line was ended with "DUPLEX" But Sometimes DUPLEX have one space or more as "DUPLEX " so in this case line will not printed Please ...
user avatar
2 votes
1 answer
937 views

how to replace IP address on remote host using expect

I wrote the following expect script in order to replace the IP address on remote Linux machine I use a perl one-liner for this task I get errors about can't read "HOME": no such variable , Please ...
maihabunash's user avatar
2 votes
1 answer
2k views

How to filter an array of strings in ksh

I want to remove the IP's as defined in "bb" array from "aa" array so the IP's 255.0.0.0 and 255.255.255.0 will be removed from the list in aa array. When I run my ksh code and later print the array ...
yael's user avatar
  • 1,325
2 votes
2 answers
339 views

ksh + delete number from string

the string IP include some IP address numbers as the following example echo ${IP[*]} 192.9.200.1 192.9.200.2 192.9.200.3 is it possible to remove some IP address number from the list ( using ksh ...
yael's user avatar
  • 1,325

15 30 50 per page