Computing.Net > Forums > Unix > Running scripts through ssh

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Running scripts through ssh

Reply to Message Icon

Name: shashi_sysadmin
Date: October 6, 2009 at 11:53:55 Pacific
OS: UNIX
Subcategory: General
Comment:

------------------------------------------------------------------------------------
FILES()

{
if [ -d ~/ffiles ]

then

print "The Directory ffiles exist"

if [ -r ~/bin/*.fdr ]

then

print "the ffile(s) exists and is/are readable....."

mv ~/bin/*.fdr ~/ffiles/

fi

else

print "The directory ~/ffiles doesn't exist. Creating the directory......."

mkdir ~/ffiles

print "The directory ~/ffiles is now created"


fi
}

/usr/local/bin/ssh -q user1@server1 "FILES"
---------------------------------------------------------------------------------------

Hello!

I wrote the above function in a script and i wanted to execute this one on a remote server. Can any one of you let me know how should i achieve this.

I want to pass this function through the ssh command.

I tried running the above script and I'm seing the following error

ksh: FILES: not found
-----------------------

Please let me know how should i run this on a remote server?

Thanks



Sponsored Link
Ads by Google

Response Number 1
Name: shashi_sysadmin
Date: October 6, 2009 at 12:03:35 Pacific
Reply:

I have tested the above subroutine and it works well, bt i donno why it's not working when i call from ssh.


0

Response Number 2
Name: shashi_sysadmin
Date: October 6, 2009 at 16:41:55 Pacific
Reply:

OK, The problem is solved.

Thanks


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Running scripts through ssh

Running scripts through VI www.computing.net/answers/unix/running-scripts-through-vi/1722.html

Want to run a shell script through cron job www.computing.net/answers/unix/want-to-run-a-shell-script-through-cron-job/8446.html

running unix scripts remotely using www.computing.net/answers/unix/running-unix-scripts-remotely-using/3762.html