Search Results

Search: Posts Made By: krux_rap
1,169
Posted By vgersh99
awk '!($2 in f2) { f2[$2]=$3; f1[$2]=$1;next}...
awk '!($2 in f2) { f2[$2]=$3; f1[$2]=$1;next} f2[$1] != $3{ print f1[$2] " & " $1 " are not matching for " $2}' myFile
4,399
Posted By durden_tyler
Thank you for testing it for various inputs and...
Thank you for testing it for various inputs and posting the Perl version.
I could not find a working Perl 5.10 version to test it, so am unable to reproduce the bug.
However, after searching on...
4,399
Posted By jgt
I noticed a slight error in my original script. ...
I noticed a slight error in my original script.

today=$(date +%Y%m%d)
while read quarter start end
do if [ $start -ge $today ]
then
exit
fi
if [ $today -gt $end ]
then
let...
4,399
Posted By RudiC
Would this come close to what you need: for X...
Would this come close to what you need:
for X in 20170805 20170830 20170915 20171005 20171112 20180522
do END=$(date +"%Y%m%d" -d"$X - $(date +"%d" -d$X) days")
for Q in 1 2 3 4
...
4,399
Posted By RudiC
Try this function with variable "start of fiscal...
Try this function with variable "start of fiscal year" in the first argument, the quarter in the second:
QUARTER() { TMP=$(($1 %10000/100+($2 -1)*3))
printf "%d %d " $2 $((...
2,283
Posted By MadeInGermany
# GNU only # find . -type d -mindepth 1...
# GNU only
# find . -type d -mindepth 1 -maxdepth 1 -mtime +10 -print
# portable
find . -type d \! -name . -prune -mtime +10 -print | sort |
while read dir
do
n=$(
find "$dir" -type f...
13,870
Posted By Corona688
sed 's/""|/|/g' < input > output
sed 's/""|/|/g' < input > output
13,870
Posted By Don Cragun
With awk: awk '{gsub(/\"[|]/, "|");...
With awk:
awk '{gsub(/\"[|]/, "|"); gsub(/[|]\"/, "|"); gsub(/\"\"/, "\""); print}' input
With sed:
sed -e 's/"|/|/g' -e 's/|"/|/g' -e 's/""/"/g' input
13,870
Posted By Chubler_XL
Another replace is needed if first field can be...
Another replace is needed if first field can be quoted:

awk '{gsub(/^"/,"");gsub(/\"[|]/, "|"); gsub(/[|]\"/, "|"); gsub(/\"\"/, "\""); print}' input

sed -e 's/^"//' -e 's/"|/|/g' -e 's/|"/|/g'...
13,870
Posted By Don Cragun
Good catch, but still not complete. We also have...
Good catch, but still not complete. We also have to worry about quotes in the last field:
awk '{gsub(/^\"|\"$/, ""); gsub(/\"[|]/, "|"); gsub(/[|]\"/, "|"); gsub(/\"\"/, "\""); print}' input
sed...
1,283
Posted By alister
The skeleton of a different approach: paste...
The skeleton of a different approach:

paste ... | while read ...; do
nohup ... &
nohup ... &
wait
done

Regards,
Alister

---------- Post updated at 07:10 PM ----------...
1,283
Posted By Yoda
typeset -i counter=0 typeset prev_param ...
typeset -i counter=0
typeset prev_param
typeset curr_param

while read in
do
counter=`expr $counter + 1`
modulus=`expr $counter % 2`

if [ $modulus -eq 0 ]
...
1,732
Posted By Lem
What about this different approach? The example...
What about this different approach?
The example below is for 4 total instances, 2 of them run simultaneously.
i=0; while((i<=4)); do while (( $(pgrep -c myscript) < 2 )); do let i++ ; nohup...
3,464
Posted By ctsgnb
1) Which OS do you run ? 2) So you want your...
1) Which OS do you run ?
2) So you want your script to take 2 input arguments in format YYYYMMDD, and then, for every day in between these date, it check whether it can find an existing file with...
3,464
Posted By ctsgnb
To know on which unix plateform you are, use the...
To know on which unix plateform you are, use the command
uname -a
Showing results 1 to 15 of 15

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