Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Problems running script on remote Terminal Post 302368577 by lozyness on Thursday 5th of November 2009 05:28:01 AM
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
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
dtsdate(1m)															       dtsdate(1m)

NAME
dtsdate - Sets local clock from a remote dtsd server host SYNOPSIS
dtsdate [-q] [-s] [-u] remote_host [nsecs] ARGUMENTS
Queries the difference in time between the local host and the remote host, but does not change the local clock. The returned result (2 if the time would have been reset, 1 if there was an error, and 0 otherwise) can be used by a script to determine what action to take. Causes dtsdate to work silently, without showing the time. Shows the time in UTC, rather than in the current time zone. The name or the IP address of a remote host that has a dtsd server. An integer giving the number of seconds by which the remote and local host times can dif- fer, without the local host's clock being reset. If nsecs is 0, or if it is not specified, it is treated as if it were extremely large, and no resetting occurs. DESCRIPTION
The dtsdate command sets the local clock of a system to be the same as the host remote_host, running a dtsd server. The purpose of dtsdate is to ensure that clock skew is minimized at initial cell configuration or at host instantiation, because it is difficult to start DCE and its components if the skew is too great. Clocks among all DCE components must be within five minutes of each other, to prevent failure of CDS and of security. Some DCE components have even more stringent requirements. For instance, a DFS file server cannot start if its local host differs from other DFS hosts by more than ten seconds. The dtsdate command can be used for adjusting a clock backwards, before DCE is running on a host. Adjusting a clock backwards while DCE is running can cause many difficulties, because security and file system software generally require system time to increase monotonically. NOTES
The remote host must be running as a DTS server. This means that the dtsd on that system must have registered the DTS management inter- face, because dtsdate uses the management call to get the current time from that host. For dtsdate to be able to set the clock, it must run as a privileged user (root). EXIT VALUE
If the -q argument is given, dtsdate returns 2 if the remote time and local time differ by more than nsecs, 1 if there was an error, and 0 otherwise. If the -q argument is not given, dtsdate returns 1 if there was an error, and 0 otherwise. EXAMPLES
With only the host argument: dtsdate remotehost dtsdate prints out the time on the remote host. In this example: dtsdate -s -q remotehost 10 dtsdate does not print out the remote host's time. If the times differ by more than 10 seconds, it returns the value of 1, otherwise 0. In the next example: dtsdate -s remotehost 10 dtsdate sets the clock if it differed from the remote clock by more than 10 seconds. It does this work silently, because of the -s option. The following example shows a shell script that uses the return value of dtsdate: dtsdate -s -q remhost 10 result = $? if [ $result -eq 0 ] ; then echo "Time is within tolerence." elif [ $result -eq 1 ] ; then echo "Could not contact remote host." >&2 else # result = 2 if dtsdate remhost 10; then # it failed! echo "Could not set the clock." >&2 fi fi RELATED INFORMATION
Commands: dtsd(1m) dtsdate(1m)
All times are GMT -4. The time now is 12:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy