Search Results

Search: Posts Made By: MadeInGermany
4,067
Posted By MadeInGermany
file=$1 if [ -f $file.gz ] then...
file=$1
if [ -f $file.gz ]
then command="gunzip -c"
else command=cat
fi
$command $file | awk -F"[/ ]" -v S="24/01/2013 10:10" -v E="24/01/2013 10:30" '
function dcmp(b) {
...
4,067
Posted By MadeInGermany
You miss the closing ' at the very end! An...
You miss the closing ' at the very end!
An exercise:
echo '
this
is
a
multiline
string'

And
echo '
line1
line2' > newfile
4,067
Posted By MadeInGermany
if [ -f $file.gz ] then command="gunzip...
if [ -f $file.gz ]
then command="gunzip -c"
else command=cat
fi1. You do want to test for $file.gz, don't you.
2. The shell [ ] wants a space on both sides. If you like you can...
4,067
Posted By MadeInGermany
On traditional Unix zcat is linked to the...
On traditional Unix zcat is linked to the traditional uncompress rather than gunzip.
In this case replace zcat with gunzip -c.
4,067
Posted By MadeInGermany
Any sh-compatible shell will do it, because it...
Any sh-compatible shell will do it, because it does nothing than passing a multi-line 'string' to awk. But the awk version matters!
Surprisingly, Solaris nawk does not handle expr{dig,dig}.
Here...
4,067
Posted By MadeInGermany
Amazing! Your code works with Posix-compatible...
Amazing!
Your code works with Posix-compatible GNU awk and HP-UX awk.
Somehow Solaris nawk does not work (prints nothing),
and Solaris Posix /usr/xpg4/bin/awk wants correct arguments:
-v S="..."...
Showing results 1 to 6 of 6

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