LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-17-2008, 08:44 AM   #1
imkornhulio
Member
 
Registered: Aug 2008
Posts: 58

Rep: Reputation: 15
Error while running the script


I am getting error when i run this script "syntax error near unexpected token 'do' Please help!

run
do script "scp filename me@my.server:/export/home/me/"
delay 1
do script "password"
end tell
 
Old 09-17-2008, 08:58 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by imkornhulio View Post
I am getting error when i run this script "syntax error near unexpected token 'do' Please help!

run
do script "scp filename me@my.server:/export/home/me/"
delay 1
do script "password"
end tell
Some more detailed information would be nice, so folks could help you.

What scripting language is this? Is this the whole script, or is there more you haven't included? What kind of system are running this on?

You didn't happen to write this on a Windows system, did you? Sometimes notepad/wordpad puts control characters on every line, and they must be removed.
 
Old 09-17-2008, 09:03 AM   #3
imkornhulio
Member
 
Registered: Aug 2008
Posts: 58

Original Poster
Rep: Reputation: 15
this script is written in shell on a linux box for uploading a file to remote host. I want to write a script to upload a file to remote host without prompting for password and without using dsa pub and private keys.
 
Old 09-17-2008, 09:31 AM   #4
imkornhulio
Member
 
Registered: Aug 2008
Posts: 58

Original Poster
Rep: Reputation: 15
Help Please
 
Old 09-17-2008, 10:08 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by imkornhulio View Post
this script is written in shell on a linux box for uploading a file to remote host. I want to write a script to upload a file to remote host without prompting for password and without using dsa pub and private keys.
Your script appears to be written for an Apple. The "end tell" and "do script" mean nothing for a bash script.

If you don't want to perform a keyswap to do passwordless logins, you'll have to use expect, and hard-code your password into the script (VERY unsafe). A quick Google search will bring up lots of samples:

http://www.linuxjournal.com/article/8600
http://www.kclug.org/pipermail/kclug...er/012303.html

And FYI, multiple posts 30 minutes apart, asking for more help is fairly annoying.
 
Old 09-17-2008, 07:21 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
If you want to use Linux, specifically bash and related tools, read these:

http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/
http://rute.2038bug.com/index.html.gz
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
why am getting error ksh: syntax error: `fi' unexpected while running script deb4you Linux - Newbie 4 09-06-2008 08:37 AM
error in running the shell script bhandu Linux - Newbie 1 07-10-2007 01:16 AM
error in running the script bhandu Linux - Newbie 4 07-03-2007 09:24 AM
i get an error message running php script inside a cgi script. repolona Linux - Software 0 02-22-2007 09:10 PM
Error running postrotate script... Jake_B Red Hat 0 09-19-2005 04:34 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration