Sponsored Content
Full Discussion: Phrasing err ssh...
Top Forums Shell Programming and Scripting Phrasing err ssh... Post 302418119 by cfajohnson on Monday 3rd of May 2010 06:18:02 AM
Old 05-03-2010
Quote:
Originally Posted by id100
below cmd (to get current hour - 1) works in localhost...whereas to get the same value in remote host..no result.. looks some pharsing error...can someone help?

Code:
$ date
Monday,  3 May 2010 09:15:46 GMT
$ perl -e 'print "" . localtime(time()-$ARGV[0]) . "\n";' 3600
Mon May  3 08:15:57 2010
$
$ ssh -i prv_key user@host "perl -e 'print "" . localtime(time()-$ARGV[0]) . "\n";' 3600"
$


Escape the inner quotes:
Code:
ssh -i prv_key user@host "perl -e 'print \"\" . localtime(time()-$ARGV[0]) . \"\n\";' 3600"

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

tar write err

This isn't causing me a problem, but it is puzzling (& slightly worrying) me. If I use tar to copy to a tape & the tape is write protected, I only get the message 'tar: tape write err' if there are a few files to copy. eg. # tar cvf /dev/rStp4 /usr/data will produce the messages ... (4 Replies)
Discussion started by: Kevin Pryke
4 Replies

2. Shell Programming and Scripting

Err while using find command

hi frnds, I have written a script as follows. ssh username@servername "find $1 -type f -name $2 -mtime +1 -exec rm '{}' \;" when i excute tis script i get error FIND: Parameter format not correct parameter 2 is the file name .. . Thx in advance (6 Replies)
Discussion started by: vikramsnest
6 Replies

3. Shell Programming and Scripting

sccs get -ek command is throwing err

Hi, get -ek s.Communicator.java The difference between the current date and the creation date of the newest delta in the SCCS file is greater than 1 year. Make sure that the system date is set correctly. This message is only a warning. (co11) 14.3 ... (0 Replies)
Discussion started by: Shivaprasad BS
0 Replies

4. AIX

Can I display err log again after run errclear

After run errclear, it will clean the err log file. After that, if I still need display the log has been cleared by errclear, how can I do? thanks (5 Replies)
Discussion started by: rainbow_bean
5 Replies

5. UNIX for Advanced & Expert Users

truss: script runs without, but 'sysntax err' with it ?!

When I run a script with truss it is exiting with error. Without truss the script runs fine! How to understand it? I have used the truss to resolve a 'magic' disappearing, but it brings own questions. The main problem is in a backgroun script, which on one server just disapeares,... (5 Replies)
Discussion started by: alex_5161
5 Replies

6. Shell Programming and Scripting

Getting err with 'awk' command

Hi All, I am trying to run the below cmd thro' a script. awk 'NR>=48&&NR<=(58-1)' $IN_FILE_NAME | tee $OUT_FILE_NAME but I am getting an err while running the script. It gives the below err msg : awk: syntax error near line 1 awk: bailing out near line 1 (P.S Note: When run the... (6 Replies)
Discussion started by: askumarece
6 Replies

7. Shell Programming and Scripting

Syntax err near unexpected token...

I've been looking at this code too long. Maybe a fresh set of eyes can spot the: "syntax error near unexpected token `(' ./phmenu ` tput cup 18 4: echo "Accept? (y) es or (n)o: " This is the line in the code: tput cup 18 4; echo "Accept? (y)es or (n)o: " Thanks In Advance... (3 Replies)
Discussion started by: Ccccc
3 Replies

8. Shell Programming and Scripting

Ksh script: std Out/err

Hello gurus, this is part of my script: ls -1 ${MyFile} >> ${dir_log}ListFile${Now}.tmp FILENUM=`cat ${dir_log}ListFile${Now}.tmp| wc -l | awk '{print $1}'`>> /dev/null if then writeError "ERRORE: no file in directory for type ${FileName}!" >> ${LogFileName} Close 1 fi... (7 Replies)
Discussion started by: GERMANICO
7 Replies

9. UNIX for Dummies Questions & Answers

Getting Perl err.msg when I login?

Hi, When I login to system. root or any of the user, I get Perl error message. Please advise.... When I login as a user.... I get this err.msg. Terminal type is vt100 You have new mail. bash: /usr/local/bin/perl: cannot execute binary file when I login as root. Terminal type... (2 Replies)
Discussion started by: samnyc
2 Replies

10. Solaris

I/O error Err#5 EIO

Hi gurus, My Solaris version is Solaris 10 1/06 s10s_u1wos_19a SPARC Im getting I/O error while trying to ls -l a directory in Solaris SPARC box the truss output from server is attached below truss -fall -vall -wall -rall ls -la 12278/1: acl("./dat", GETACLCNT, 0,... (3 Replies)
Discussion started by: Solaris_Begin
3 Replies
Epoch(3)						User Contributed Perl Documentation						  Epoch(3)

NAME
Time::Epoch - Convert between Perl epoch and other epochs SYNOPSIS
#!/usr/bin/perl -wl use Time::Epoch; my $perlsec = 966770660; # Sun Aug 20 07:24:21 2000 -0400 on Mac OS my $epochsec = perl2epoch($perlsec, 'macos', '-0400'); my $perlsec2 = epoch2perl($epochsec, 'macos', '-0400'); print $perlsec; print $perlsec2; print $epochsec; # correct time on Unix: print scalar localtime $perlsec; # correct time on Mac OS (-0400): print scalar localtime $epochsec; DESCRIPTION
Exports two functions, "perl2epoch" and "epoch2perl". Currently only goes between Perl (Unix) epoch and Mac OS epoch. This is in preparation for an eventual move of Perl to its own universal epoch, so we can get the system epoch of any platform that differs from Perl's. Epochs o macos Takes additional optional parameter of time zone differential. If time zone differential not supplied, we guess by getting the different between "localtime" and "gmtime" with <Time::Local::timelocal>. BUGS
o Hm. With the above test, "scalar localtime $perlsec" under my Linux box and "scalar localtime $epochsec" under my Mac OS box are off by one second from each other. Maybe a leap second thing? Odd. AUTHOR
Chris Nandor <pudge@pobox.com>, http://pudge.net/ Copyright (c) 2000-2003 Chris Nandor. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License, distributed with Perl. SEE ALSO
perl(1), perlport(1), Time::Local. perl v5.18.2 2003-05-21 Epoch(3)
All times are GMT -4. The time now is 04:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy