Search Results

Search: Posts Made By: jaituteja
2,134
Posted By ahamed101
#!/bin/bash val=0 while read line do ...
#!/bin/bash

val=0
while read line
do
cur=$( date -d "${line%%,*}" '+%s' )
test "$cur" -gt "$val" && val=$cur
done < infile

date -d @$val '+%d %b %Y %T'
--ahamed
1,386
Posted By ahamed101
s/.*/read='&' or/g Replace everything with the...
s/.*/read='&' or/g
Replace everything with the format you want. '&' will have the entire search string.

$ {s/or//g}
You dont want the "or" at the end of the last line right? So, when the last...
1,386
Posted By ahamed101
Try this... sed "s/.*/read='&' or/g;$...
Try this...

sed "s/.*/read='&' or/g;$ {s/or//g}" infile


--ahamed
1,386
Posted By balajesuri
while read x; do echo "reader='$x' or"; done <...
while read x; do echo "reader='$x' or"; done < inputfile

sed -e "s/^/reader='/g" -e "s/$/' or/g" inputfile
3,921
Posted By balajesuri
$# --> Refers to the number of parameters...
$# --> Refers to the number of parameters provided at command line alongside scriptname.
[ $# -ne 2 ] --> Number of parameters ($#) is not equal (-ne) to two (2)
&& --> Logical 'and' operator....
3,921
Posted By balajesuri
In the first parameter why did you give...
In the first parameter why did you give milliseconds? -- 26 Dec 2011 11:39:43,070
That was not your original requirement right? Anyway, that shouldn't matter.

Post the output of the following...
Showing results 1 to 6 of 6

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