Sponsored Content
Full Discussion: Remote if find call failing
Top Forums Shell Programming and Scripting Remote if find call failing Post 302491504 by Corona688 on Thursday 27th of January 2011 03:49:29 PM
Old 01-27-2011
Code:
ssh serverx "touch -t $(date +%Y%m%d)${HOURMINVAR} file1;
          if [ `find file2 -newer file1` ];
          then echo 'Message 1';
          else echo 'Message 2'; fi;"

Any variables and such are being substituted before the string gets transmitted, that includes backticks. You can escape them like so:
Code:
ssh serverx "touch -t $(date +%Y%m%d)${HOURMINVAR} file1;
          if [ \`find file2 -newer file1\` ];
          then echo 'Message 1';
          else echo 'Message 2'; fi;"

This User Gave Thanks to Corona688 For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

csh failing to call an 2 embedded csh script

I have an extraordinary problem with a csh script.....(feel free to berate the use of this but I'm modifying an existing bunch of them) Anyway, I have a master csh script which in turn calls a second csh script. This second csh script is below. Within this second script are two compiled C++... (1 Reply)
Discussion started by: pollsizer
1 Replies

2. Solaris

How to get RPC(Remote Proceedure Call) values?

Guys, Help me out in getting the RPC resource values of the system. By running the ipcs command i get the HEXA values of the IPC(Inter Process Communication) values in the system like q 12760 0x10fe4d88 --rw-rw-rw- a-1982 cts m 686089 0x10fe4d48 --rw-rw-rw- a-1982 ... (2 Replies)
Discussion started by: meheretoknow
2 Replies

3. UNIX for Advanced & Expert Users

help remote procedure call

i am beginig with unix c code for sun remote procedure call to do the following: 1- The clients reads in a variable length array from the command line 2- The client offers a menu for the user to choose what to do with the array: a. Sort the array b. Add the array c. Find max d. Find... (1 Reply)
Discussion started by: auto2000
1 Replies

4. Programming

help remote procedure call

i am beginig with unix c code for sun remote procedure call to do the following: 1- The clients reads in a variable length array from the command line 2- The client offers a menu for the user to choose what to do with the array: a. Sort the array b. Add the array c. Find max d. Find... (1 Reply)
Discussion started by: auto2000
1 Replies

5. UNIX for Dummies Questions & Answers

help remote procedure call

i am beginig with unix c code for sun remote procedure call to do the following: 1- The clients reads in a variable length array from the command line 2- The client offers a menu for the user to choose what to do with the array: a. Sort the array b. Add the array c. Find max d. Find... (1 Reply)
Discussion started by: auto2000
1 Replies

6. Programming

help remote procedure call

am beginig with unix c code for sun remote procedure call You are to write a program using RPC facility to do the following: 1- The clients reads in a variable length array from the command line 2- The client offers a menu for the user to choose what to do with the array: a. Sort the array... (1 Reply)
Discussion started by: auto2000
1 Replies

7. Shell Programming and Scripting

Remote call not hiding password fields

Not sure on the description, but here is a quick rundown. I have 2 servers, we'll call them serverA serverB On serverB, I am calling a script that inside it has the following: ssh srvdsadm@serverB sudo -u dsadm /opt/apps/DataStage/scripts/autoDeploy.sh ${projName} ${subProjVar}... (1 Reply)
Discussion started by: cbo0485
1 Replies

8. Programming

Is it possible to call remote function in another daemon?

Hi, Is it possible to call a remote function in another daemon? Here is the setup: I have two daemons daemon A with function "s" and daemon B with function "k". I need a way function "s" from daemon A to call a function "k" from daemon B and pass some arguments. When the request is ... (13 Replies)
Discussion started by: rcbandit
13 Replies

9. Shell Programming and Scripting

Script failing to run successfully on remote node

Hi guys, I have a scenario where i want to run a script from Node A. It ssh's into Node B and runs some awk commands there plus deposiriting the output on Node B. Challenge is that the awk commands run properly when executed locally on Node B but fail when within the script on Node B. I do not... (0 Replies)
Discussion started by: jerkesler
0 Replies
TTYNAME(3)						     Linux Programmer's Manual							TTYNAME(3)

NAME
ttyname, ttyname_r - return name of a terminal SYNOPSIS
#include <unistd.h> char *ttyname(int desc); int ttyname_r(int desc, char *buf, size_t buflen); DESCRIPTION
The function ttyname() returns a pointer to the NUL-terminated pathname of the terminal device that is open on the file descriptor desc, or NULL on error (for example, if desc is not connected to a terminal). The return value may point to static data, possibly overwritten by the next call. The function ttyname_r() stores this pathname in the buffer buf of length buflen. RETURN VALUE
The function ttyname() returns a pointer to a pathname on success. On error, NULL is returned, and errno is set appropriately. The func- tion ttyname_r() returns 0 on success, and an error number upon error. ERRORS
Values stored in errno by a failing ttyname() or returned by a failing ttyname_r(): EBADF Bad file descriptor. ENOTTY File descriptor does not refer to a terminal device. ERANGE buflen was too small to allow storing the pathname. CONFORMING TO
POSIX.1 SEE ALSO
fstat(2), isatty(3) Linux 2002-07-20 TTYNAME(3)
All times are GMT -4. The time now is 07:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy