Problems running script on remote Terminal


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Problems running script on remote Terminal
# 1  
Old 11-05-2009
Problems running script on remote Terminal

Hi,
I'm new here so please excuse any stupidity that occurs in my post :P
My situation:
Have a java program which I have to run a ridiculous amount of times and put the output data into a text file.
Thought the easiest way to do this would be to delve into the world of scripts.
I am at home (on a mac) with remote access to my university computers (linux).
Wrote a script which I think might possibly work:

Code:
i=50
while [ $i <= 1000]
do
    java RMIClient telford-00 1090 $i > "$i.txt"
    count='expr $i + 10'
done

I uploaded it into the same directory as the code
Followed some instructions on the internet to chmod it using:
Code:
chmod +x RMIScript.sh

Where RMIScript is the name of the script.

Tried to run it using both:
Code:
sh ./RMIScript.sh

and
Code:
./RMIScript.sh

however both come out with errors 'cannot open =: No such file'

Any advice would be appreciated.

Edit:
Changed code to:
Code:
i=50
while [ $i -lt 1000]
do
    java RMIClient telford-00 1090 $i > "$i.txt"
    i=$[i + 10]
done

same error.

Last edited by lozyness; 11-05-2009 at 09:45 AM.. Reason: Change in code
# 2  
Old 11-06-2009
come out with errors 'cannot open =: No such file'

Paste the error as it is, this way we will be able to identify the issue.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Running shell script in Cygwin terminal

I am new to shell scripting. I tried to run a simple shell script using Cygwin terminal in Win XP env. The script I have written is as follows - #!/bin/bash a=5 ] && echo "true" || echo "false" But when I execute the script, getting some confusing error. The error I am getting are - ... (3 Replies)
Discussion started by: linux_learner
3 Replies

2. Shell Programming and Scripting

script does not close terminal after running

For a small script i want it so that the terminal closes when the script has completed its tasks. To do so i use at the end if the script the following: echo "Hello, World!" echo "Knowledge is power." echo "" echo "shutting down terminal in 10 seconds" exit 10 however the terminal stay's... (3 Replies)
Discussion started by: Ditzyken
3 Replies

3. Shell Programming and Scripting

Problems running script in cron...

Hi all, I have a script running on a Solaris 8 box and the first thing it does it check which user is executing it; if ; then echo "This script must be run as testuser" 1>&2 exit 1 fi This works fine when manually running the script however when adding into that users' crontab it... (1 Reply)
Discussion started by: JayC89
1 Replies

4. Red Hat

Problems with script running with crontab

Hi, I'm trying the backup a few information commands of my Check Point FW (it's on a SPLAT linux machine). This is the script I wrote: #!/bin/bash cd /var/tmp/ file1=netstat_`/bin/date +%d%m%y`.txt file2=ifconfig_`/bin/date +%d%m%y`.txt file3=cpstatos_`/bin/date +%d%m%y`.txt... (2 Replies)
Discussion started by: nirsh
2 Replies

5. Shell Programming and Scripting

How to stop a script running in remote server from local script

Hi, I have googled for quite some time and couldn't able to get what exactly I am looking for.. My query is "how to stop a shell script which is running inside a remote server, using a script"??? can any one give some suggestions to sort this out. (1 Reply)
Discussion started by: mannepalli
1 Replies

6. Shell Programming and Scripting

running terminal with script

suppose we have a file ab 81 and another file exec < $1 while read line do ssh root@172.16.1.$line done while running the command sh file.sh ab output display as shown Pseudo-terminal will not be allocated because stdin is not a terminal. root@172.16.1.81's password: after... (3 Replies)
Discussion started by: cdfd123
3 Replies

7. Shell Programming and Scripting

Problems in running a Perl script via cronjob

I have a very basic perl script that attempts to find if a process is running. If the process is not running then the script is supposed to start the process. If I execute the script from command line it works fine as expected. However if the script is executed via cronjob, the script cannot find... (1 Reply)
Discussion started by: ypant
1 Replies

8. Shell Programming and Scripting

Running a script without a terminal session

I'm trying to figure out how I can run a script "myScript.sh" in such a way that if my remote network connection gets disconnected, the script doesn't stop functioning. Right now I log in, run "./myScript.sh" and watch my output get pumped to a log file for about 10 hours. Only problem is that... (3 Replies)
Discussion started by: jjinno
3 Replies

9. UNIX for Dummies Questions & Answers

problems running a sql loader script

Hi Folks, I have created a number of unix scripts that i can run from the scheduler on a server-side application that we use (Chordiant Marketing Director). All scripts are working except one. This last script is a user load script which first truncates a table and then loads it using a flat... (2 Replies)
Discussion started by: jibbadiah
2 Replies

10. UNIX for Dummies Questions & Answers

Running Script from Telnet - Problems

...so I read "The Pragmatic Programmer" and they stressed the value of learning shell scripting! I'm in a UNIX environment but have a Windows XP workstation. I'm using Telnet to issue UNIX commands. I've done plenty of chmod's, command line ftp and stuff, but written no scripts to this point.... (1 Reply)
Discussion started by: pauljohn
1 Replies
Login or Register to Ask a Question