how to automate scp for multiple server? [closed] - linux

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I have IPs of all machines are in one text file,how to do scp from one machine to all machines and automate task?

cat ips.txt | xargs -rtn1 sh -c 'scp /source-file "${1}:/target-file"' --
You probably need to adjust the command to your actual needs, which you didn't state.

Related

How to mask query param values in Linux [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
Need help on below requirement.
I have a file with list of URLs and need to mask query param values as shown in below example in Linux.
http://hostname:port/uri?data=value&data1=value2&data3=value3
to
http://hostname:port/uri?data=XXX&data1=XXX&data3=XXX
thanks
you could replace any character that is not a &, it is more efficient than enumerating all possible ranges:
$ echo 'http://hostname:port/uri?data=value&data1=va%20lue2&data3=value3' | \
sed -r 's/=[^&]+/=XXX/g'
http://hostname:port/uri?data=XXX&data1=XXX&data3=XXX

Make screen shooter in bash [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have to make script similar to Screen Shooter. Unfortunately I am green in this topic. In connection with this I would like to ask if it is possible to write such a script? I know ScreenShots are possible, but can they be handled?
Regards
Example, screenshot script :
#!/bin/sh
import screen$RANDOM.jpg;
exit 0;
The script will display a cross-hair for selecting "screenshot size".
import is an imagemagick command : sudo apt install imagemagick
http://packages.ubuntu.com/xenial-updates/imagemagick

How to traverse when using `cat` command? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
How to travel in the shell using cat command? (arrow keys are not working)
cat > myfile
I think you are asking for a pager. For that you can use more or less (yes, these are the real names). As an example, you can use cat FILE | less or just less FILE. In there, you can scroll/search/... (exit with q).

Extract IPs before string [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have this text:
111.11.1.111(*)222.22.2.221(mgn)333.33.3.333(srv)
111.11.1.111(*)333.33.3.333(srv)222.22.2.222(mgn)
222.22.2.223(mgn)111.11.1.111(*)333.33.3.333(srv)
I only want to know the IP's before (mgn), output:
222.22.2.221
222.22.2.222
222.22.2.223
thanks
Through grep,
$ grep -oP '(?:\d{1,3}\.){3}\d{1,3}(?=\(mgn\))' file
222.22.2.221
222.22.2.222
222.22.2.223
Through sed,
$ sed 's/.*\b\(\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}\)(mgn).*/\1/g' file
222.22.2.221
222.22.2.222
222.22.2.223

Build Perl to binary code stand alone [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
How to build perl script in a bianry form ? and it is executable on i686 GNU/Linux
without any additional package or library
perlbin
pp
Also see:
How does PAR::Packer work?
The easy way to build stand-alone Perl apps

Resources