AIX 6, operation on time in script


 
Thread Tools Search this Thread
Operating Systems AIX AIX 6, operation on time in script
# 1  
Old 03-18-2015
AIX 6, operation on time in script

Hi

I have a question,

On linux (centos) I am executing a script:

Code:
#!/bin/bash

st1=`date "+%T"`
SD=`date -u -d $st1 +"%s"`

#some operations ...

st2=`date "+%T"`
FD=`date -u -d $st2 +"%s"`

time_oper=`date -u -d "0 $FD sec - $SD sec" +"%H:%M:%S"`
echo "Time script execution - " $time_oper >> log.log

in log.log file I have a time script execution.

But now I want to execute this script on AIX 6 and I can't becouse I have this error:
Code:
date: 0551-402 Invalid character in date/time specification.

any idea ??

Thanks
# 2  
Old 03-18-2015
install gnu date, if you need the same syntax, or read man date ;-)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk script to find data in three file and perform replace operation

Have three files. Any other approach with regards to file concatenation or splitting, etc is appreciated If column55(billngtype) of file1 contains YMNC or YPBC then pick the value of column13(documentnumber). Now find this documentnumber in column1(Billdoc) of file2 and grep the corresponding... (4 Replies)
Discussion started by: as7951
4 Replies

2. Shell Programming and Scripting

String operation in csh AIX 4.3.2.0

Hi to everybody i stuck on a simple thing i had a string and i want cut it , i try already few thing with the cut command but does not the way it should. The script is in csh and running on AIX 4.3.2.0 here are few samples how the string can look like FT71;1;1;1;;;1;31.01.2017... (9 Replies)
Discussion started by: Nadielosabra
9 Replies

3. AIX

Monitoring AIX with System Center Operation Manager 2007 R2

I can get my AIX servers to show up in SCOM but I'm struggling with running personal scripts and have the result of these scripts show up in SCOM. I'm currently using BigBrother and I've written some scripts for BB. I would like to convert these scripts to something that can be used in SCOM. ... (0 Replies)
Discussion started by: petervg
0 Replies

4. Shell Programming and Scripting

Column operation : cosne and sine operation

I have a txt file with several columns and i want to peform an operation on two columns and output it to a new txt file . file.txt 900.00000 1 1 1 500.00000 500.00000 100000.000 4 4 1.45257346E-07 899.10834 ... (4 Replies)
Discussion started by: shashi792
4 Replies

5. Shell Programming and Scripting

<AIX>Problem in purge script, taking very very long time to complete 18.30hrs

Hi, I have here a script which is used to purge older files/directories based on defined purge period. The script consists of 45 find commands, where each command will need to traverse through more than a million directories. Therefore a single find command executes around 22-25 mins... (7 Replies)
Discussion started by: sravicha
7 Replies

6. Shell Programming and Scripting

awk - operation over time staps

Hi @ all, I'm trying to accomplish a simple excel-job with awk, without any result... What i have is a file with a time stamp for each line like : 21:02:07 21:04:11 21:06:28 21:08:44 21:10:45 21:12:48 21:14:52 21:16:53 21:18:55 What i would, is to calculate the time elapsed... (7 Replies)
Discussion started by: m4rco-
7 Replies

7. UNIX for Dummies Questions & Answers

what does the operation '>&' mean in a shell script

hi, all, i saw a syntax like this usr/local/mpiexec -np 8 /home/XXXX/program_exe >& ./temp/out the output will be put into ./temp/out. I want to know the meaning of the operation symbol '>&'. Thanks (3 Replies)
Discussion started by: cy163
3 Replies

8. Shell Programming and Scripting

division operation in shell script

Hi guys I am trying to divide 2 variables that I got during the execution of script, but I unable to divide the variables. pls help. Hers is the code. num_tasks=`sqlplus -s batch_user/batch_user@acsblest << EOF1 set heading off SET FEEDBACK OFF SET PAGESIZE 0 SET LINESIZE 900 select... (31 Replies)
Discussion started by: ragha81
31 Replies

9. AIX

AIX 5.3 errpt full of message: DISK OPERATION ERROR

Hi All, Can anyone explain me the meanning of the following errors: LABEL: SC_DISK_ERR2 IDENTIFIER: B6267342 Description DISK OPERATION ERROR Probable Causes DASD DEVICE Failure Causes DISK DRIVE DISK DRIVE ELECTRONICS Recommended Actions PERFORM PROBLEM DETERMINATION... (1 Reply)
Discussion started by: gianlu
1 Replies

10. AIX

AIX 4.3 Openssh 3.7.1.0 Operation

I am new/just getting used to this group (Unix Forums), but did search around. I saw a listing for "openssh for AIX" in which a response indicated a link was posted in the original post, but I couldn't find that link or another "original post", so first, if someone could enlighten me why I couldn't... (2 Replies)
Discussion started by: ripley
2 Replies
Login or Register to Ask a Question