Sponsored Content
Top Forums Shell Programming and Scripting How to export the function in ssh Post 302603729 by raghu.iv85 on Thursday 1st of March 2012 10:58:22 PM
Old 03-01-2012
How to export the function in ssh

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

Code:
#/bin/bash

logs_gen () {
          XXXXXXXXXXX
          XXXXXXXXXXX
          XXXXXXXXXXX
}

for i in x y z; do # x y z are the server names
ssh -q ${i}<< EOF
logs_gen #Here it is giving errors while executing this function.. like command not found.
exit
EOF
done

Could anyone suggest on this how to export the variable pls?

Regards,
VRN
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Passing global variable to a function which is called by another function

Hi , I have three funcions f1, f2 and f3 . f1 calls f2 and f2 calls f3 . I have a global variable "period" which i want to pass to f3 . Can i pass the variable directly in the definition of f3 ? Pls help . sars (4 Replies)
Discussion started by: sars
4 Replies

2. Shell Programming and Scripting

Run function from script over ssh (BASH)

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

3. Shell Programming and Scripting

ssh running on function

i have a problem regarding running an ssh command while inside "function" script structure #!/usr/bin/bash func1(){ script=$1 ssh user@server "$script" } cat script.txt | while read line do func1 $line done exit 0 the problem is when ssh ran,... (1 Reply)
Discussion started by: ryandegreat25
1 Replies

4. Shell Programming and Scripting

Running a function on a remote server via SSH in a script

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

5. Shell Programming and Scripting

korn shell - export function??

Hi, I have a question. I know that if I want to access any variables defined in a calling script (script1.ksh) in a called script (script2.ksh) I need to export that variable in the calling script to make it available in the called script. But what about the functions in the calling script? ... (1 Reply)
Discussion started by: dips_ag
1 Replies

6. Shell Programming and Scripting

Run recursive function with variables over SSH

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

7. Shell Programming and Scripting

Export a function to another function

is there a way to export a function to another function? i'm using #!/usr/xpg4/bin/sh in the first line of my script. firstfunc () { echo $1 is nice } secondfunc () { firstfunc Nancy } when i run a similar scenario to the above, i get: /usr/xpg4/bin/sh: firstfunc: not found (4 Replies)
Discussion started by: SkySmart
4 Replies

8. Shell Programming and Scripting

[bash] running a function remotely using ssh

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

9. Shell Programming and Scripting

Will files, creaetd in one function of the same script will be recognized in another function?

Dear All. I have a script, which process files one by one. In the script I have two functions. one sftp files to different server the other from existing file create file with different name. My question is: Will sftp function recognize files names , which are created in another... (1 Reply)
Discussion started by: digioleg54
1 Replies

10. Shell Programming and Scripting

Function - Make your function return an exit status

Hi All, Good Day, seeking for your assistance on how to not perform my 2nd, 3rd,4th etc.. function if my 1st function is in else condition. #Body function1() { if then echo "exist" else echo "not exist" } #if not exist in function1 my all other function will not proceed.... (4 Replies)
Discussion started by: meister29
4 Replies
DateTime::Locale::el(3) 				User Contributed Perl Documentation				   DateTime::Locale::el(3)

NAME
DateTime::Locale::el SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'el' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Greek. DATA
This locale inherits from the DateTime::Locale::root locale. It contains the following data. Days Wide (format) XXXXXXX XXXXX XXXXXXX XXXXXX XXXXXXXXX XXXXXXX XXXXXXX Abbreviated (format) XXX XXX XXX XXX XXX XXX XXX Narrow (format) X X X X X X X Wide (stand-alone) XXXXXXX XXXXX XXXXXXX XXXXXX XXXXXXXXX XXXXXXX XXXXXXX Abbreviated (stand-alone) XXX XXX XXX XXX XXX XXX XXX Narrow (stand-alone) X X X X X X X Months Wide (format) XXXXXXXXXX XXXXXXXXXXX XXXXXXX XXXXXXXX XXXXX XXXXXXX XXXXXXX XXXXXXXXX XXXXXXXXXXX XXXXXXXXX XXXXXXXXX XXXXXXXXXX Abbreviated (format) XXX XXX XXX XXX XXX XXXX XXXX XXX XXX XXX XXX XXX Narrow (format) X X X X X X X X X X X X Wide (stand-alone) XXXXXXXXXX XXXXXXXXXXX XXXXXXX XXXXXXXX XXXXX XXXXXXX XXXXXXX XXXXXXXXX XXXXXXXXXXX XXXXXXXXX XXXXXXXXX XXXXXXXXXX Abbreviated (stand-alone) XXX XXX XXX XXX XXX XXXX XXXX XXX XXX XXX XXX XXX Narrow (stand-alone) X X X X X X X X X X X X Quarters Wide (format) 1X XXXXXXX 2X XXXXXXX 3X XXXXXXX 4X XXXXXXX Abbreviated (format) X1 X2 X3 X4 Narrow (format) 1 2 3 4 Wide (stand-alone) 1X XXXXXXX 2X XXXXXXX 3X XXXXXXX 4X XXXXXXX Abbreviated (stand-alone) X1 X2 X3 X4 Narrow (stand-alone) 1 2 3 4 Eras Wide X.X. X.X. Abbreviated X.X. X.X. Narrow X.X. X.X. Date Formats Full 2008-02-05T18:30:30 = XXXXX, 05 XXXXXXXXXXX 2008 1995-12-22T09:05:02 = XXXXXXXXX, 22 XXXXXXXXXX 1995 -0010-09-15T04:44:23 = XXXXXXX, 15 XXXXXXXXXXX -10 Long 2008-02-05T18:30:30 = 05 XXXXXXXXXXX 2008 1995-12-22T09:05:02 = 22 XXXXXXXXXX 1995 -0010-09-15T04:44:23 = 15 XXXXXXXXXXX -10 Medium 2008-02-05T18:30:30 = 05 XXX 2008 1995-12-22T09:05:02 = 22 XXX 1995 -0010-09-15T04:44:23 = 15 XXX -10 Short 2008-02-05T18:30:30 = 05/02/2008 1995-12-22T09:05:02 = 22/12/1995 -0010-09-15T04:44:23 = 15/09/-010 Default 2008-02-05T18:30:30 = 05 XXX 2008 1995-12-22T09:05:02 = 22 XXX 1995 -0010-09-15T04:44:23 = 15 XXX -10 Time Formats Full 2008-02-05T18:30:30 = 6:30:30 X.X. UTC 1995-12-22T09:05:02 = 9:05:02 X.X. UTC -0010-09-15T04:44:23 = 4:44:23 X.X. UTC Long 2008-02-05T18:30:30 = 6:30:30 X.X. UTC 1995-12-22T09:05:02 = 9:05:02 X.X. UTC -0010-09-15T04:44:23 = 4:44:23 X.X. UTC Medium 2008-02-05T18:30:30 = 6:30:30 X.X. 1995-12-22T09:05:02 = 9:05:02 X.X. -0010-09-15T04:44:23 = 4:44:23 X.X. Short 2008-02-05T18:30:30 = 6:30 X.X. 1995-12-22T09:05:02 = 9:05 X.X. -0010-09-15T04:44:23 = 4:44 X.X. Default 2008-02-05T18:30:30 = 6:30:30 X.X. 1995-12-22T09:05:02 = 9:05:02 X.X. -0010-09-15T04:44:23 = 4:44:23 X.X. Datetime Formats Full 2008-02-05T18:30:30 = XXXXX, 05 XXXXXXXXXXX 2008 6:30:30 X.X. UTC 1995-12-22T09:05:02 = XXXXXXXXX, 22 XXXXXXXXXX 1995 9:05:02 X.X. UTC -0010-09-15T04:44:23 = XXXXXXX, 15 XXXXXXXXXXX -10 4:44:23 X.X. UTC Long 2008-02-05T18:30:30 = 05 XXXXXXXXXXX 2008 6:30:30 X.X. UTC 1995-12-22T09:05:02 = 22 XXXXXXXXXX 1995 9:05:02 X.X. UTC -0010-09-15T04:44:23 = 15 XXXXXXXXXXX -10 4:44:23 X.X. UTC Medium 2008-02-05T18:30:30 = 05 XXX 2008 6:30:30 X.X. 1995-12-22T09:05:02 = 22 XXX 1995 9:05:02 X.X. -0010-09-15T04:44:23 = 15 XXX -10 4:44:23 X.X. Short 2008-02-05T18:30:30 = 05/02/2008 6:30 X.X. 1995-12-22T09:05:02 = 22/12/1995 9:05 X.X. -0010-09-15T04:44:23 = 15/09/-010 4:44 X.X. Default 2008-02-05T18:30:30 = 05 XXX 2008 6:30:30 X.X. 1995-12-22T09:05:02 = 22 XXX 1995 9:05:02 X.X. -0010-09-15T04:44:23 = 15 XXX -10 4:44:23 X.X. Available Formats d (d) 2008-02-05T18:30:30 = 5 1995-12-22T09:05:02 = 22 -0010-09-15T04:44:23 = 15 Ed (E d) 2008-02-05T18:30:30 = XXX 5 1995-12-22T09:05:02 = XXX 22 -0010-09-15T04:44:23 = XXX 15 EEEd (EEE d) 2008-02-05T18:30:30 = XXX 5 1995-12-22T09:05:02 = XXX 22 -0010-09-15T04:44:23 = XXX 15 H (H) 2008-02-05T18:30:30 = 18 1995-12-22T09:05:02 = 9 -0010-09-15T04:44:23 = 4 HHmm (HH:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 09:05 -0010-09-15T04:44:23 = 04:44 HHmmss (HH:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Hm (H:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 9:05 -0010-09-15T04:44:23 = 4:44 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 X.X. 1995-12-22T09:05:02 = 9:05 X.X. -0010-09-15T04:44:23 = 4:44 X.X. Hms (H:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 hms (h:mm:ss a) 2008-02-05T18:30:30 = 6:30:30 X.X. 1995-12-22T09:05:02 = 9:05:02 X.X. -0010-09-15T04:44:23 = 4:44:23 X.X. M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (d/M) 2008-02-05T18:30:30 = 5/2 1995-12-22T09:05:02 = 22/12 -0010-09-15T04:44:23 = 15/9 MEd (E, d/M) 2008-02-05T18:30:30 = XXX, 5/2 1995-12-22T09:05:02 = XXX, 22/12 -0010-09-15T04:44:23 = XXX, 15/9 MMdd (dd/MM) 2008-02-05T18:30:30 = 05/02 1995-12-22T09:05:02 = 22/12 -0010-09-15T04:44:23 = 15/09 MMM (LLL) 2008-02-05T18:30:30 = XXX 1995-12-22T09:05:02 = XXX -0010-09-15T04:44:23 = XXX MMMd (d MMM) 2008-02-05T18:30:30 = 5 XXX 1995-12-22T09:05:02 = 22 XXX -0010-09-15T04:44:23 = 15 XXX MMMEd (E, d MMM) 2008-02-05T18:30:30 = XXX, 5 XXX 1995-12-22T09:05:02 = XXX, 22 XXX -0010-09-15T04:44:23 = XXX, 15 XXX MMMMd (d MMMM) 2008-02-05T18:30:30 = 5 XXXXXXXXXXX 1995-12-22T09:05:02 = 22 XXXXXXXXXX -0010-09-15T04:44:23 = 15 XXXXXXXXXXX MMMMdd (dd MMMM) 2008-02-05T18:30:30 = 05 XXXXXXXXXXX 1995-12-22T09:05:02 = 22 XXXXXXXXXX -0010-09-15T04:44:23 = 15 XXXXXXXXXXX MMMMEd (E, d MMMM) 2008-02-05T18:30:30 = XXX, 5 XXXXXXXXXXX 1995-12-22T09:05:02 = XXX, 22 XXXXXXXXXX -0010-09-15T04:44:23 = XXX, 15 XXXXXXXXXXX mmss (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 ms (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yM (M/yyyy) 2008-02-05T18:30:30 = 2/2008 1995-12-22T09:05:02 = 12/1995 -0010-09-15T04:44:23 = 9/-010 yMEd (EEE, d/M/yyyy) 2008-02-05T18:30:30 = XXX, 5/2/2008 1995-12-22T09:05:02 = XXX, 22/12/1995 -0010-09-15T04:44:23 = XXX, 15/9/-010 yMMM (MMM y) 2008-02-05T18:30:30 = XXX 2008 1995-12-22T09:05:02 = XXX 1995 -0010-09-15T04:44:23 = XXX -10 yMMMEd (EEE, d MMM y) 2008-02-05T18:30:30 = XXX, 5 XXX 2008 1995-12-22T09:05:02 = XXX, 22 XXX 1995 -0010-09-15T04:44:23 = XXX, 15 XXX -10 yMMMM (LLLL y) 2008-02-05T18:30:30 = XXXXXXXXXXX 2008 1995-12-22T09:05:02 = XXXXXXXXXX 1995 -0010-09-15T04:44:23 = XXXXXXXXXXX -10 yQ (y Q) 2008-02-05T18:30:30 = 2008 1 1995-12-22T09:05:02 = 1995 4 -0010-09-15T04:44:23 = -10 3 yQQQ (y QQQ) 2008-02-05T18:30:30 = 2008 X1 1995-12-22T09:05:02 = 1995 X4 -0010-09-15T04:44:23 = -10 X3 yyMM (MM/yy) 2008-02-05T18:30:30 = 02/08 1995-12-22T09:05:02 = 12/95 -0010-09-15T04:44:23 = 09/-10 yyMMM (MMM yy) 2008-02-05T18:30:30 = XXX 08 1995-12-22T09:05:02 = XXX 95 -0010-09-15T04:44:23 = XXX -10 yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 yyQQQQ (QQQQ yy) 2008-02-05T18:30:30 = 1X XXXXXXX 08 1995-12-22T09:05:02 = 4X XXXXXXX 95 -0010-09-15T04:44:23 = 3X XXXXXXX -10 yyyy (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yyyyMM (MM/yyyy) 2008-02-05T18:30:30 = 02/2008 1995-12-22T09:05:02 = 12/1995 -0010-09-15T04:44:23 = 09/-010 yyyyMMMM (MMMM y) 2008-02-05T18:30:30 = XXXXXXXXXXX 2008 1995-12-22T09:05:02 = XXXXXXXXXX 1995 -0010-09-15T04:44:23 = XXXXXXXXXXX -10 Miscellaneous Prefers 24 hour time? No Local first day of the week XXXXXXX SUPPORT
See DateTime::Locale. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT
Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. perl v5.18.2 2017-10-06 DateTime::Locale::el(3)
All times are GMT -4. The time now is 10:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy