Search Results

Search: Posts Made By: fnds
9,025
Posted By fnds
Instead of checking the file size you should...
Instead of checking the file size you should check if the file is open. You can use the fuser utility to do that:


f=/tmp/x.x
test ! -f $f && echo file not found && exit
c=`fuser -f $f 2>&1 |...
1,361
Posted By fnds
echo waiting ... while true do date...
echo waiting ...
while true
do
date
test `date '+%H:%M'` == "12:00" && echo time is up && break
test ! -f /tmp/x.x && echo file not found, sleeping ... && sleep 10
...
1,086
Posted By fnds
Please provide an example.
Please provide an example.
2,755
Posted By fnds
$ sed -e 's/, *,/,NIS,/g' -e 's/, *$/,NIS/g'...
$ sed -e 's/, *,/,NIS,/g' -e 's/, *$/,NIS/g' <<INPUT
> MARKET,STORE,STORE NAME,WEEK1,WEEK2
> MARKET,STORE1,STORENAM1, 000000003.99,
> MARKET,STORE1,STORENAM2,NH,NH
> MARKET,STORE1,STORENAM3,...
2,755
Posted By fnds
$ awk -F, '$4 == "" {print $1 "," $2 "," $3...
$ awk -F, '$4 == "" {print $1 "," $2 "," $3 ",NIS," $5} $4 != "" {print $0}' <<INPUT
> MARKET,STORE,STORE NAME,WEEK1,WEEK2
> MARKET,STORE1,STORENAM1, 000000003.99,
> MARKET,STORE1,STORENAM2,NH,NH...
114,859
Posted By fnds
This solution is better as it works for decimals...
This solution is better as it works for decimals as well:


$ x=a; printf "%g" $x >/dev/null 2>&1; if [ $? -eq 0 ]; then echo is number; else echo not number; fi
not number
$ x=9a; printf "%g"...
114,859
Posted By fnds
$ $ x=1; if [ "`expr $x - $x 2>/dev/null`" ==...
$
$ x=1; if [ "`expr $x - $x 2>/dev/null`" == "0" ]; then echo is number; else echo not number; fi
is number
$ x=-1; if [ "`expr $x - $x 2>/dev/null`" == "0" ]; then echo is number; else echo not...
43,299
Posted By fnds
<deleted>
<deleted>
Showing results 1 to 8 of 8

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