10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all.
I need a bash script to run a function remotely. I think it should be similar to the following but can't figure out the exact syntax.
Here is the script:
#!/bin/bash
function nu ()
{
for var in {0..5}; do printf "$var, "; done; echo
}
ssh host "$(typeset -f); nu"
... (9 Replies)
Discussion started by: ziguy
9 Replies
2. Shell Programming and Scripting
Hello Everyone,
I am writing a shell script to fetch log files from remote servers within a time range. It copies log files to local server, grep for date and then compares the time stamp of each log entry with the once specified.
Below is the code.
# Get log and Parsing function
... (1 Reply)
Discussion started by: kanagalamurali
1 Replies
3. Shell Programming and Scripting
Hi All,
I have a cron job set up which is set to run every 10 seconds.
What I need to do is have the script do a check to see if it is already running such that if it is running it wont fire up additional instances and processes according to its normal process.
For example if I have a script... (4 Replies)
Discussion started by: landossa
4 Replies
4. Shell Programming and Scripting
I an using the below functions in my script.
---------
checkRT()
{
subHeader "Runtime Check"
for nn in `cat $HOST_FILE|egrep -i 'msdp|ca|backup|db'|grep -v '#'|sed '/^$/d'|awk '{ print $1":"$2":"$3}'`
do
fhba=`expr $nn|cut -d: -f2`
fhba2=`expr $nn|cut -d: -f3`
subSubHeader $fhba2
ssh... (1 Reply)
Discussion started by: nandan8a
1 Replies
5. Shell Programming and Scripting
Hi Gurus,
I have a requirment to use a function created in a script in another server within the script. Below is the sample script for reference
#/bin/bash
logs_gen () {
XXXXXXXXXXX
XXXXXXXXXXX
XXXXXXXXXXX
}
for i in x y z; do # x y z are the server... (7 Replies)
Discussion started by: raghu.iv85
7 Replies
6. Shell Programming and Scripting
Hi,
I have the below script that should take the command line option and run the desired script on another server. Only it doesn't seem to run the function, infact it just returns back to the command line.
case $1 in
1) msgbacklog() ;;
2) jobstatus() ;;
... (10 Replies)
Discussion started by: chris01010
10 Replies
7. Shell Programming and Scripting
Hi,
I don't know if you can help or if this is even possible, but I am trying to run the following function over an ssh and (depending on the itteration I choose) keep getting unexpected token or undefined symbol errors.
The function is:
killtree()
{
typeset parent=$1
typeset child... (1 Reply)
Discussion started by: RECrerar
1 Replies
8. Shell Programming and Scripting
I'm working on a script (mostly for practice) to simplify a task I have to do every now and then. I have a cluster with 6 servers on it, each server has a directory with a set of files called *.pid and *.mpid. Each file contains the pid of a process that may or may not be running on that server.... (3 Replies)
Discussion started by: DeCoTwc
3 Replies
9. Shell Programming and Scripting
Hi All
I am new to perl so had one question.
I have one Subroutine which works as expected and below is just an example.
where I ran a command and check the output.
so my question is if I have more than one command then how to check the results, meaning I want to add more command and check... (2 Replies)
Discussion started by: tannu
2 Replies
10. Shell Programming and Scripting
Hi,
Is there any cleaver way to run function from the bash scrip over ssh?
For example:
#!/bin/bash
#Function 1
FN1 ()
{
ls -l
}
#Main run
ssh user@host FN1
exit 0
Yeah, I know it will not work, but I'm asking how to make it to work :)
I'm suspecting that it would be... (1 Reply)
Discussion started by: columb
1 Replies