Ssh from a ksh returning not found message


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Ssh from a ksh returning not found message
# 1  
Old 08-19-2015
Ssh from a ksh returning not found message

Script name is test.ksh
I know that that the ssh command is working properly, this can be verified by the value returned in respond variable. It is unique to the remote server
_____________________________________________________
Code:
respond=$(ssh $remoteHost find /xxx/xxxxxxxx/xxx/xxxxx/xxxx/xxx/xxx -type f -mtime -7)
if [[ -z $respond ]]
then
   echo "NOT updated $respond"
else
   echo "UPDATED $respond"
fi

______________________________________________________________
right before this command I echo out several statements including the $remoteHost value
start script --echo from script
Connecting to xxx@xxxxxxxx -echo from script
./test.ksh[26]: --: not found.
What I don't understand is the generated line above, is it looking for my script on the remote server, if so why? Is there something I should be doing so it does not?
Thanks for any help

Last edited by vgersh99; 08-19-2015 at 05:56 PM.. Reason: code tags, please!
# 2  
Old 08-19-2015
What is line 26?
# 3  
Old 08-19-2015
Code:
respond=$(ssh $remoteHost 'find /xxx/xxxxxxxx/xxx/xxxxx/xxxx/xxx/xxx -type f -mtime -7')

# 4  
Old 08-19-2015
got my answer

Thanks guys, being a unix developer sometimes is showing its spots. I had a comment line with sql comment -- in front of it instead of unix #. I guess I didn't realize it was calling out a line number. Learn something new every day.
I appreciate you calling out the obvious.
This User Gave Thanks to Adagio For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

not found message

I am trying to execute a script called tfile.sh in a bash shell in solaris and it throws up the following message I am getting the required output after this message. How do i get the message to disappear. Can someone please point out my mistake in the script? Thanks in advance ... (13 Replies)
Discussion started by: goddevil
13 Replies

2. Shell Programming and Scripting

not found message

I am executing the following script in a bash shell in solaris and it throws up the following message : But i get the output that i require nevertheless. Can anyone please spot what is causing the warning and how do i get it go away? VAR1="e6842w2334f76figtl5.systems.grp" if 76fig`... (2 Replies)
Discussion started by: goddevil
2 Replies

3. Shell Programming and Scripting

Script returning an error message on exiting

Hi, I am writing a script in which I am using an IF-Else statement. Code sample: # Check for the product. If (test "$3" = "Pet") Then Product_Code="PI" elif (test "$3" = "Breakdown") Then Product_Code="RI" elif (test "$3" = "Travel") Then Product_Code="TI" ... (2 Replies)
Discussion started by: bghosh
2 Replies

4. UNIX for Dummies Questions & Answers

Not Found message in script execution

Hi gurus, I'm having a strange problem and I hope you can help me solving it. I'm working in Unix Solaris, version 5.10, ksh. I have a script with environment variables which I have to execute prior to other scripts. The script belongs to userA and when I log in, and cd to its directory. It... (4 Replies)
Discussion started by: ermur
4 Replies

5. Shell Programming and Scripting

why the message not found in the file

Hi, I am a newbie for shell programming and met some question about redirect output to a file. See the details. #!/usr/bin/sh ... ./doSomething.pl >> RAW_DATA echo "testing is done !" >> RAW_DATA Descirption: doSomething.pl do a bit complex things and output some message. I append... (3 Replies)
Discussion started by: programmerBegin
3 Replies

6. Shell Programming and Scripting

Function not found message

I have shell script as below: #!/bin/ksh #set -xv function set_variable { VARIABLE_NAME=$1 CURRENT_PATH=`pwd` if ; then echo "\nconfiguration_file.lst file not found in $CURRENT_PATH/common/common_scripts" exit 1; fi VARIABLE_COUNT=`cat... (2 Replies)
Discussion started by: findprakash
2 Replies

7. UNIX for Dummies Questions & Answers

Loop on array variable returning error: 0 not found

I'm guessing i have a syntax error. I'm not sure it get's past the the while condition. I get an error 0 not found. Simple loop not sure what I'm doing wrong. #!/usr/bin/ksh set -A MtPtArray /u03 /u06 tUbound=${#MtPtArray } echo $tUbound i=0 while ($i -lt $tUbound) do print... (4 Replies)
Discussion started by: KME
4 Replies

8. Shell Programming and Scripting

Return a message when a file is not found

Hi there, I am writing a script to look for tmp log files that have not been access within the last 10 days. I am using the follwing command within the script: find /var/tmp -name *log -atime -9 ¦xargs What I would like to be able to do would be to display a message if there is no... (3 Replies)
Discussion started by: lodey
3 Replies

9. Shell Programming and Scripting

Returning a BLOB to Ksh

Hello, I am currently using a small script to test out part of a larger script I will use llater on. I am querying Oracle 10.1 to return a column which holds a blob value. This value needs unzipped, sent to a file or piped and then amended and re-inserted to another table with the news values.... (2 Replies)
Discussion started by: jack1981
2 Replies

10. Shell Programming and Scripting

How do I prevent cron from returning errors on a file not found?

find: /home/Upload/*: No such file or directory I am getting a find error when I run for FILE in `find /home/Upload/* -prune -type f -newer TIMEFILE` do I need to run this job every 10 minutes to upload any new files that were added. Is there an easy way to prevent this? Thanks (6 Replies)
Discussion started by: goodmis
6 Replies
Login or Register to Ask a Question