Hi,
I am working on a sever A.
I want to write a perl script to execute a shell script persent on the server B.
please help me in this.
thanks in advance.
I have two questions:
There are multiple remote linux machines, and I need to write a shell script which will execute the same set of commands in each machine. (Including some sudo operations). How can this be done using shell scripting?
When ssh'ing to the remote machine, how to handle when it prompts for RSA fingerprint authentication.
Imagine a shell script on the remote server as
#!/bin/bash
rm /test.x
How can I (if possible) to execute this script from my local machine to delete /test.x file on my local machine.
I am new to shell script. I have two perl scripts for text processing based on two different input files.I would like to have one shell script that run based on conditions.
if(input file) matches word /extraction_reversed/ run perlscript1.pl otherwise run perlscript2.pl.
Shell script to compile in terminal
sh run.sh inputfile > outputfile
Hi Folks,
I have 2 perl scripts and I need to execute 2nd perl script from the 1st perl script in WINDOWS.
In the 1st perl script that I had, I am calling the 2nd script
main.pl
===========
print "This is my main script\n";
`perl C:\\Users\\sripathg\\Desktop\\scripts\\hi.pl`;
hi.pl ( this script I am calling from the firstperlscript.pl)
====
#!perl -w
print "hii Gir
I would like to know how to automate an already made shell script (all the steps of all the commands done on a specific folder) by utilizing a list (a .txt) of all folder names that the shell scripts goes and executes
For example:
In the working folder called main/ there are subfolders named folder1, folder2, folder3.....folder100 and shell script shell.sh.
vi shell.sh
Code:
perl au
I have made a shell script(/bin/sh) that starts a perl script (that I haven't made my self) that's starts a ssh session. The ssh session uses a private/public key to login so no password is needed. The Perl script works perfect.
But when I put it in a cronjob (crontab) the ssh connection asks for password. This makes the scripts fail. Seems like ssh keys are not working while running in cron.
In the Perl documentation, perlrun(1) suggests launching Perl scripts using a bilingual shell/Perl header:
#!/bin/sh
#! -*-perl-*-
eval 'exec perl -x -wS $0 ${1+"$@"}'
if 0;
What does ${1+"$@"} mean? I tried using "$@" instead (using Bash as /bin/sh), and it seems to work just as well.
Edit
Two answers below say that it's supposed to be ${1:+"$@"}.
Hi,
I have a perl script that takes in 2 numerical values as ARGV[].
Code:
perl script.pl parameter1 num1 num2
in my case I have 1000's of num1 and num2. I can have them in separate files. Please let me know how to automate this run using shell scripting or using awk, so that I don't have to enter all the values.