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:
I uploaded it into the same directory as the code
Followed some instructions on the internet to chmod it using:
Where RMIScript is the name of the script.
Tried to run it using both:
and
however both come out with errors 'cannot open =: No such file'
Any advice would be appreciated.
Edit:
Changed code to:
same error.
Last edited by lozyness; 11-05-2009 at 09:45 AM..
Reason: Change in code
...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)
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)
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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT HPUX
dtsdate
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)