Sponsored Content
Full Discussion: Help need urgently....
Top Forums Shell Programming and Scripting Help need urgently.... Post 302369757 by chinniforu2003 on Monday 9th of November 2009 01:02:10 PM
Old 11-09-2009
I am trying to run this one in telnet


Code:
#!/bin/ksh
File1=simple.txt    # The file to check
LogFile=simple.log # The log file
DelayMax=30 # Timeout delay
Tolerance=2
# BEGIN ##############################
while true
do
    StampNow=$(date +%s)/60    # stamp in minutes
    StampFile=$(date -r "$File1" +%s)/60
    let Delay=$StampNow-$StampFile
    if [ $Delay -gt $DelayMax ]
    then
        echo "TIME STARTED = $(date +%Y-%m-%d_%H:%M:%S)" > $LogFile
	echo "TIME ENDED = $(date +%Y-%m-%d_%H:%M:%S)"  >> $LogFile
        # etc.
        exit 1
    elif [ $StampFile -eq $StampOld ]
    then
        sleep $Tolerance  # Retry a bit later
    else
        StampOld=$StampFile
        let NewDelay=$StampNow-$StampFile+15+$Tolerance # To synchronize with the updating
        sleep $NewDelay minutes
    fi
done



---------- Post updated at 02:01 PM ---------- Previous update was at 02:00 PM ----------

Below is the error log

Code:
date: bad format character - s
date: illegal option -- r
Usage: date [-u] [+format]
       date [-u] [mmddhhmm[[cc]yy]]
       date [-a [-]sss.fff]
sam.ksh[11]: Delay=/60-/60: syntax error
sam.ksh[18]: /60: syntax error
sam.ksh[23]: NewDelay=/60-/60+15+2: syntax error
usage: sleep time



---------- Post updated at 02:02 PM ---------- Previous update was at 02:01 PM ----------

To be frank i am totally new to this scripting.

Please help

Last edited by pludi; 11-09-2009 at 02:19 PM.. Reason: code tags, please...
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

link and unlink , urgently...

Hi all I did something incorrectly about link command. I try to make a link from a sub-dir to root dir, but I use the following command: link / zzz the result is sub-dir "zzz" was linked to "/" Then I want to remove the "zzz" by using unlink command: unlink zzz It say that "Device... (1 Reply)
Discussion started by: umonk
1 Replies

2. UNIX for Dummies Questions & Answers

Need Information Urgently.

Hi i dont know about the UNIX OS at all but now as my Project requires, i need to learn it as soon as possible. Could anybody please help me out in suggessting any good elementary book on UNIX OS so that atleast i can learn the commands for UNIX servers and at the same time within the short span... (3 Replies)
Discussion started by: sumit_krishan
3 Replies

3. Shell Programming and Scripting

Need help urgently

Hi to All, I m a regular visitor of this site but this one is my first thread . Although I ve tried but I cant find the solution .:confused: I ve number of files having extension .file., which having some define statement in it.The files consits as follows Ex:- abc.file `define ADCONV0 ... (3 Replies)
Discussion started by: user_prady
3 Replies

4. Shell Programming and Scripting

help needed urgently

hi all i need help I am confused and stucked. Actually i am new in this scripting stuff. I want to give complete txt file as a input to a variable and then sort the data in the file according to the alpha numeric characters, as my text file contains ! and !! and !!! indicating Minor, Major and... (11 Replies)
Discussion started by: nabmufti
11 Replies

5. UNIX for Dummies Questions & Answers

CC Solution Required Urgently

Hi there, My question is: If the command cc is executed on obelix, what executable file will be run? Using the results of whereis, which and any other commands you consider necessary, explain why this file is executed. Please help as soon as possible thanks (5 Replies)
Discussion started by: satty
5 Replies

6. Solaris

most urgently about pc-routing

Hi I have knowledge is a little about Solaris 10. I have problem route Question I have two lan interfaces nge0 >> 192.168.1.1 / 24 and link up Client1 >> 192.168.1.10 not out internet (GW 192.168.1.254) nge1 >> 192.168.50.220 /24 and link up Client50 >> 192.168.50.1 can... (2 Replies)
Discussion started by: sermsuk
2 Replies

7. UNIX for Advanced & Expert Users

Help needed Urgently... Thanks in advance

You have a file called /opt/test/input.txt with the following information: man_aa_bld_100.410.040_CMD 08/14/2008 23:29:21 08/14/2008 23:31:10 SU 5339491/1 man_aa_bld_100.410.050_CMD 08/14/2008 23:29:21 08/14/2008 23:31:11 SU 5339491/1 man_aa_bld_100.410.060_CMD 08/14/2008 ... (3 Replies)
Discussion started by: jkumsi
3 Replies

8. Shell Programming and Scripting

Script command - need help urgently

I have added script command to the .profile of the id, whose session needs to be captured. When exit command is issued, the script command exits. Is there a way to exit the parent shell also - and log off the system completely with one exit command? (8 Replies)
Discussion started by: ggayathri
8 Replies

9. Shell Programming and Scripting

Case Stmt - Need Help Urgently

Hello All, Need help urgently.. i have a scenario where i have two files 1) mireport_20111406.txt 2) PRLIHSP01_8080.2011-06-11-15_26_31 ---------- I want a query something similar to this algorithm :- Case when file_name is like mireport then extract_date=14-06-2011 when... (4 Replies)
Discussion started by: iamnoone
4 Replies

10. UNIX for Dummies Questions & Answers

Need answers urgently!!

hello guys!! need 1 favour from u all.. Can u jst tell me the answers for these ques?? 1. ls - l _____ : command to return all files that end with single digit and those with TXT extension 2. ls -l report* _______ : command to return all files that start with the word RPT except those with LOG... (1 Reply)
Discussion started by: Gan_7
1 Replies
platform::shell(n)					       Tcl Bundled Packages						platform::shell(n)

__________________________________________________________________________________________________________________________________________________

NAME
platform::shell - System identification support code and utilities SYNOPSIS
package require platform::shell ?1.1.4? platform::shell::generic shell platform::shell::identify shell platform::shell::platform shell _________________________________________________________________ DESCRIPTION
The platform::shell package provides several utility commands useful for the identification of the architecture of a specific Tcl shell. This package allows the identification of the architecture of a specific Tcl shell different from the shell running the package. The only requirement is that the other shell (identified by its path), is actually executable on the current machine. While for most platform this means that the architecture of the interrogated shell is identical to the architecture of the running shell this is not generally true. A counter example are all platforms which have 32 and 64 bit variants and where a 64bit system is able to run 32bit code. For these running and interrogated shell may have different 32/64 bit settings and thus different identifiers. For applications like a code repository it is important to identify the architecture of the shell which will actually run the installed packages, versus the architecture of the shell running the repository software. COMMANDS
platform::shell::identify shell This command does the same identification as platform::identify, for the specified Tcl shell, in contrast to the running shell. platform::shell::generic shell This command does the same identification as platform::generic, for the specified Tcl shell, in contrast to the running shell. platform::shell::platform shell This command returns the contents of tcl_platform(platform) for the specified Tcl shell. KEYWORDS
operating system, cpu architecture, platform, architecture platform::shell 1.1.4 platform::shell(n)
All times are GMT -4. The time now is 03:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy