Passing complex commands with ssh is problematic, because there are two shells that evaluate the script: one on the local host and one on the remote host.
Save the script on the local host, and pass it via stdin to the remote shell:
The -s option allows to place script arguments
This User Gave Thanks to MadeInGermany For This Post:
I'm trying to compare 2 dates between current time and the timestamp on a file.
The date format is mmdd
Both return Apr 1 but when using if statement
line 11: Apr 1: command not found error is returned
#!/bin/sh
log="DateLog"
Current_Date=`date +%b%e`
Filepmdate=`ls -l /file.txt |... (1 Reply)
Hello to all.
I work at AIX system without perl installed and I am restricted user, so I am limited to bash. In script that I am writing, I have to read line from file and transform date that I found inside to Unix timestamp. Line in file look something like this:
Tue Mar 29 06:59:00... (5 Replies)
I am doing this in my script ..
currenttimestamp=`db2 "select current timestamp from SYSIBM.SYSDUMMY1 with ur"`
echo s $currenttimestamp
but this is how its shows
s 1 -------------------------- 2011-04-18-12.43.25.345071 1 record(s) selected.
How can I just get the timestamp... (6 Replies)
Hi All,
I am new to unix programming. I am trying for a requirement and the requirement goes like this.....
I have a test folder. Which tracks log files. After certain time, the log file is getting overwritten by another file (randomly as the time interval is not periodic). I need to preserve... (2 Replies)
Hi,
In a field, I should receive the date with time stamp in a particular field. But sometimes the vendor sends just the date or the timestamp or correctl the date×tamp. I have to figure out the the data is a date or time stamp or date×tamp.
If it is date then append "<space>00:00:00"... (1 Reply)
I was looking at this script which outputs the two lines which differs less than one sec.
#!/usr/bin/perl -w
use strict;
use warnings;
use Time::Local;
use constant SEC_MILIC => 1000;
my $file='infile';
## Open for reading argument file.
open my $fh, "<", $file or die "Cannot... (1 Reply)
I have a file like this
-rwxr-xr-x 1 rewq other 168 Jan 13 07:05 check_files.sh
I want to compare (check_files.sh time) with the current time to see if its is older than 2 hours or not
if it is not older than 2 hrs then do something.can someone help me on this?.I dont... (7 Replies)
Hello ,
I am working on AIX. I have to convert Unix timestamp to normal timestamp. Below is the file. The Unix timestamp will always be preceded by
EFFECTIVE_TIME as first field as shown and there could be multiple EFFECTIVE_TIME in the file : 3.txt
Contents of... (6 Replies)
Hi Gurus,
I have a software which logs event in the log file and it has become to big to search into it.
I want to display all the lines from the log files between
<Jul 21, 2016 3:30:37 PM BST> to <Jul 21, 2016 3:45:37 PM BST>
that is 15 min data .
Please help
Use code tags, thanks. (10 Replies)
So basically I have a log file and each line in this log file starts with a timestamp:
MON DD HH:MM:SS
SEP 15 07:30:01
I need to grep all the lines between last hour timestamp and current timestamp. Then these lines will be moved to a tmp file from which I will grep for particular strings. ... (1 Reply)
Discussion started by: nms
1 Replies
LEARN ABOUT HPUX
ssh-argv0
SSH-ARGV0(1) BSD General Commands Manual SSH-ARGV0(1)NAME
ssh-argv0 -- replaces the old ssh command-name as hostname handling
SYNOPSIS
hostname | user@hostname [-l login_name] [command]
hostname | user@hostname [-afgknqstvxACNTX1246] [-b bind_address] [-c cipher_spec] [-e escape_char] [-i identity_file] [-l login_name]
[-m mac_spec] [-o option] [-p port] [-F configfile] [-L port:host:hostport] [-R port:host:hostport] [-D port] [command]
DESCRIPTION
ssh-argv0 replaces the old ssh command-name as hostname handling. If you link to this script with a hostname then executing the link is
equivalent to having executed ssh with that hostname as an argument. All other arguments are passed to ssh and will be processed normally.
OPTIONS
See ssh(1).
FILES
See ssh(1).
AUTHORS
OpenSSH is a derivative of the original and free ssh 1.2.12 release by Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
Theo de Raadt and Dug Song removed many bugs, re-added newer features and created OpenSSH. Markus Friedl contributed the support for SSH
protocol versions 1.5 and 2.0. Jonathan Amery wrote this ssh-argv0 script and the associated documentation.
SEE ALSO ssh(1)Debian Project September 7, 2001 Debian Project