Sponsored Content
Top Forums Shell Programming and Scripting UNIX script issues - Plse help guru's Post 98667 by Ygor on Thursday 9th of February 2006 09:16:31 PM
Old 02-09-2006
I think your problem is with your $HOURS and MINS calculations. If you subtract 45 from 50, for example, you get "5" not "05". So your touch command gets confused because the timestamp is not formatted "MMDDhhmm".

Since you are using ksh, you could fix using...
Code:
typeset -Z2 HOURS MINS

However, if you have perl, perhaps try...
Code:
:
#GET AND PARSE THE CURRENT DATE. SUBTRACT 45 MIN (2700 SECONDS)
STAMP=$(perl -e '($ss, $mm, $hh, $DD, $MM, $YY) = localtime(time() - 2700);
printf "%04d%02d%02d%02d%02d", $YY + 1900, $MM + 1, $DD, $hh, $mm')

#TOUCH A FILE SO THAT IT IS 45 MINUTES OLD
touch -t $STAMP /tmp/oldtime
:


Last edited by Ygor; 02-09-2006 at 10:23 PM..
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

what do most Unix guru's use ? :D

I wanted to know what email app most Sun solaris / unix gurus use ? I have become quite NON microsoft in the last few months in my studying solaris.. thanks simon2000 (6 Replies)
Discussion started by: simon2000
6 Replies

2. Solaris

define nvalias's cdrom URGENTLY plse!!!

I need help please ....... I have to urgently setup nvalias 's cdrom ....... following are the output command ...................... {7} ok banner Sun Fire 3800 OpenFirmware version 5.15.2 (08/04/03 10:27) Copyright 2001-2003 Sun Microsystems, Inc. All rights reserved. Use is... (1 Reply)
Discussion started by: tt155
1 Replies

3. Solaris

Reboot problem !!! urgent plse !!!!!!!!!!!

Operatin System : Solaris 5.9 Server : Sun Fire 3800 Shutdown and reboot i receive the following messages ..... un Fire 3800 OpenFirmware version 5.15.2 (08/04/03 10:27) Copyright 2001-2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. SmartFirmware,... (8 Replies)
Discussion started by: tt155
8 Replies

4. Shell Programming and Scripting

UNIX Guru's help on diff

Hi , I wanted to find delata between two huge ( 8 GB ) files . Say file_TDY and file_YDY : These files are sorted based on a key . I am using a command : 1)bdiff file_TDY file_YDY > diff_file 2) grep ' ^< ' diff_file > TDY_delta I wanted only the changed records and newly added... (2 Replies)
Discussion started by: ajaybalki
2 Replies

5. HP-UX

Make_Recovery Question Urgent Plse Respond

I have a make_recovery tape, if I restore the VG00 volume group using this, will my other volume groups still be ok after the restore(I have 7 data volume groups) I used make_recovery -A to create the tape I have a HP9000 HP-UX 11 An internal disk is failing, the other volume groups are on... (3 Replies)
Discussion started by: rees_a
3 Replies

6. Solaris

Advice to become a unix guru?

Hello, I have recently completed my training for Solaris 10 and have a good understanding of the bases now. I am playing around with my system but can't do much since my knowledge is limited. I am looking for some projects or some threads where I can learn more and expand my knowledge step by... (16 Replies)
Discussion started by: saudsos
16 Replies

7. Shell Programming and Scripting

Unix bash script (mv issues);

Hey guys, I've registered here as I need urgent help. This is assignment for school and as you can see below I've completed the work. I'm simply stuck on one area. :wall: This script takes the first parameter (which is to be the new extension) and each parameter after that is a file... (1 Reply)
Discussion started by: Cynosure
1 Replies

8. Shell Programming and Scripting

Issues for script that login to a unix box

Hi, I have a script that should login to a different box then the box that i am in and run the commands. I have the script sample below that logins to a unix box and get the files .Looks like ls-lrt command is not running or its wrongly used. #!/bin/bash # Ask the user for build month... (5 Replies)
Discussion started by: learninguser235
5 Replies

9. Shell Programming and Scripting

Shell script guru

Hey Gurus, Need help to modify the shell script. I am really new in the Linux/Unix world and dont familiar with shell scripting. SO bascially my script is running a ( curl ) with some endpoints and returning HTTP status code. Now i have a 50 different endpoints and cant make each and individual... (3 Replies)
Discussion started by: Zach Kadiwal
3 Replies
GRID-PROXY-INFO(1)						  Globus Commands						GRID-PROXY-INFO(1)

NAME
grid-proxy-info - Display information about a proxy certificate SYNOPSIS
grid-proxy-info [-help] [-usage] [-version] grid-proxy-info [[-subject] | [-s]] [[-issuer] | [-i]] [-identity] [-type] [-timeleft] [-strength] [-all] [-text] [-path] [-rfc2253] [{-exists | -e} [[-valid HOURS:MINUTES] | [-v HOURS:MINUTES]] [[-hours HOURS] | [-h HOURS]] [[-bits BITS] | [-b BITS]]] DESCRIPTION
The grid-proxy-info program extracts information from an X.509 proxy certificates, and optionally displays or returns an exit code based on that information. The default mode of operation is to print the following facts about the current user's default proxy: subject, issuer, identity, type, strength, path, and time left. If the command-line option -exists or -e is included in the command-line, nothing is printed unless one of the print options is specified. Instead, grid-proxy-info determines if a valid proxy exists and, if so, exits with the exit code 0; if a proxy does not exist or is not valid, grid-proxy-info exits with the exit code 1. Additional validity criteria can be added by using the -valid, -v, -hours, -h, -bits, or -b command-line options. If used, these options must occur after the -e or -exists command-line options. Those options are only valid if one of the -e or -exists command-line options is used. The complete set of command-line options to grid-proxy-info are: -help, -usage Display the command-line options to grid-proxy-info. -version Display the version number of the grid-proxy-info command -debug Display verbose error messages. -file PROXYFILE, -f PROXYFILE Read the proxy located in the file PROXYFILE instead of using the default proxy. -subject, -s Display the proxy certificate's subject distinguished name. -issuer, -i Display the proxy certificate issuer's distinguished name. -identity Display the proxy certificate's identity. For non-independent proxies, the identity is the subject of the certificate which issued the first proxy in the proxy chain. -type Display the type of proxy certificate. The type string includes the format ("legacy", "draft", or RFC 3280 compliant), identity type ("impersonation" or "independent"), and policy ("limited" or "full"). See grid-proxy-init(1) for information about how to create different types of proxies. -timeleft Display the number of seconds remaining until the proxy certificate expires. -strength Display the strength (in bits) of the key associated with the proxy certificate. -all Display the default information for the proxy when also using the -e or -exists command-line option. -text Display the proxy certificate contents to standard output, including policy information, issuer, public key, and modulus. -path Display the path to the file containing the default proxy certificate. -rfc2253 Display distinguished names for the subject, issuer, and identity using the string representation described in RFC 2253, instead of the legacy format. -exists, -e Perform an existence and validity check for the proxy. If a valid proxy exists and matches the criteria described by other command-line options (if any), exit with 0; otherwise, exit with 1. This option must be before other validity check predicate in the command-line options. If this option is specified, the output of the default facts about the proxy is disabled. Use the -all option to have the information displayed as well as the exit code set. -valid HOURS:MINUTES, -v HOURS:MINUTES, -hours HOURS, -h HOURS Check that the proxy certificate is valid for at least HOURS hours and MINUTES minutes. If it is not, grid-proxy-info will exit with exit code 1. -bits BITS, -b BITS Check that the proxy certificate key strength is at least BITS bits. ENVIRONMENT VARIABLES
The following environment variables affect the execution of grid-proxy-info: X509_USER_PROXY Path to the default user proxy. SEE ALSO
grid-proxy-init(1), grid-proxy-destroy(1) AUTHOR
University of Chicago Globus Toolkit 5.0.2 04/25/2011 GRID-PROXY-INFO(1)
All times are GMT -4. The time now is 08:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy