Search Results

Search: Posts Made By: phpsnook
16,379
Posted By phpsnook
i figured out a way to use batch file to check...
i figured out a way to use batch file to check if the done file is there. i find is the file is there using the verbose mode of sftp. downside of using batch is that there will not be any return...
16,379
Posted By phpsnook
SFTP check if file exists
I lookifn for a way to SFTP a file based on the presence of a flag file .

The logic is some thing like this in shelling terms

IF [[ ! -s file.DDMM.done ]]; then
download file.DDMM.dat...
15,739
Posted By phpsnook
Using Wildcards in scp
to scp using windcards you use the following :


scp 'hostname:/home/username/diff_201110*' .


Enjoy !
5,828
Posted By phpsnook
Formating and Parsing Autosys output
if you want to parse the output from an autosys you can use the below


autorep -j Prefix_% | awk '{
if ($6 ~ /^[0-9]/)
printf "%-20s \t\t %-20s\n",$1,$5 ;
else if ($6 ~ /^[A-Z]/)
...
1,692
Posted By phpsnook
Thanks yazu! oneliner works it did find a...
Thanks yazu! oneliner works

it did find a round about way to do, not proud of it though ;)


cut -c 270-271 main.txt | egrep -n '33|H1|HA|KA|26' | awk -F ':' '{print $1 }' >> main.lineno
...
1,692
Posted By phpsnook
Print line if subsrt matches array
Hi Folks!

im printing all lines where the characters in position 270-271 match 33|H1|HA|KA|26 so i came up with this


#!/bin/bash
array=(33 H1 HA KA 26 )
for i in "${array[@]}"
do...
1,914
Posted By phpsnook
Think this works ! echo 1313675999 | perl...
Think this works !


echo 1313675999 | perl -e ‘use Time::localtime; $tm=localtime(); printf(“%d/%d/%d\n”, $tm->mday, $tm->mon+1, $tm->year+1900);'
1,914
Posted By phpsnook
Think i got it ! echo 1313675999 | perl...
Think i got it !


echo 1313675999 | perl -e 'use Time::localtime; $tm=localtime(<>); printf("%d/%d/%d\n", $tm->mday, $tm->mon+1, $tm->year+1900);'
1,914
Posted By phpsnook
can someone tell me in what format this timestamp...
can someone tell me in what format this timestamp is '1313675999'
1,914
Posted By phpsnook
No luck with that :(
No luck with that :(
1,914
Posted By phpsnook
Reformating unix date
Hi i have a unix date in file a file like this '1313675999'
in oracle i would do it like this

select TO_CHAR ( TO_DATE ('01011970', 'DDMMYYYY')+ 1 / 24 / 60 / 60 * 1313675999,'YYYYMMDD') from...
2,012
Posted By phpsnook
position of character in a line
i want to find the position of a character in a line , the first position, last, 5th occurence position , i ve tried grep -n , and expr index but they dont fit the bill. Please let me know if...
2,754
Posted By phpsnook
hi Corona688! thanks !..i want the script to...
hi Corona688! thanks !..i want the script to exit with status 1 when the string in the is found ....
2,754
Posted By phpsnook
pattern match in live stream
hi!

i have a situation like this where i have to analyse the live log generated from

/bin/scp -v you@example.com

is if a pattern like say "Too many connections" comes i shud be able to...
2,034
Posted By phpsnook
check DSA keys
hi!

i have a scenario where the dsa key's might be tampered in the remote host.
My shell script is doing something like this


/bin/ssh -v -i /home/erp/.ssh/dsa ref@host ls...
Showing results 1 to 15 of 15

 
All times are GMT -4. The time now is 04:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy