Search Results

Search: Posts Made By: RudiC
144
Posted By RudiC
Or provide a default value in case harr[$j] is...
Or provide a default value in case harr[$j] is empty / unset:
if [ ${harr1[$j]:-1} -eq $search ]
then break
fi
247
Posted By RudiC
Shells don't expand variables within single...
Shells don't expand variables within single quotes.
187
Posted By RudiC
Any attempts / ideas / thoughts from your side? ...
Any attempts / ideas / thoughts from your side?
Your OS and shell?
231
Posted By RudiC
Given your uniq provides all the options shown,...
Given your uniq provides all the options shown, try
sort -k4,4 file | uniq -D -f3 -w5
40993876 4531 724 10154 Strep A
40993878 4533 724 10154 Strep B
40991764 2419 ...
190
Posted By RudiC
Yes, in your above example it will print alpha...
Yes, in your above example it will print alpha and beta, but in general, it will print the before-last field.
190
Posted By RudiC
It's the same as $NF - the last field in the...
It's the same as $NF - the last field in the input line regardless of its actual field number.
awk splits the line into n fields and then assigns n to NF (number of fields?) If you have three...
225
Posted By RudiC
As the number of / may vary with path depth, or...
As the number of / may vary with path depth, or with the locale date format, it might be safer to extract the relevant field first from that comma delimited file:
cut -d ',' -f 30 file
...
206
Posted By RudiC
In case there are other occurrences of three...
In case there are other occurrences of three letters followed by a space and a digit, you might want to narrow down the search pattern to the locale months:
sed -r "s/($(locale abmon | tr ';' '|'))...
859
Posted By RudiC
Thanks, MadeInGermany, for pointing that ssh -n...
Thanks, MadeInGermany, for pointing that ssh -n option out. Still, the commands are passed as such (no backtics ``!) to the remote server, so uname -r will be executed remotely.


The script was...
116
Posted By RudiC
Double post?...
Double post? https://www.unix.com/303039567-post8.html
329
Posted By RudiC
Is it possible to e.g. sort -t, -k2,2 -k4r...
Is it possible to e.g.

sort -t, -k2,2 -k4r -k3 file
329
Posted By RudiC
Will the data follow a certain sequence, i.e....
Will the data follow a certain sequence, i.e. parent dirs sorted, parent dir before child dir, non-empty $3 before empty $3, non-empty $4 before empty $4?
329
Posted By RudiC
Why does ...
Why does

level1,/level2/level3/level4/ora003,4,IBB25
show up in file2?
111
Posted By RudiC
How about awk '{sub ($1 ",", "", $2)} 1' file ...
How about
awk '{sub ($1 ",", "", $2)} 1' file
5_2207830114 13_2207830312,15_2207830336
8_2207830145 15_2207830336
10_2207830220...
329
Posted By RudiC
What about your own approach to solve the problem?
What about your own approach to solve the problem?
329
Posted By RudiC
Any attempt / idea / thought from your side? ...
Any attempt / idea / thought from your side?


I can't see your logics example comply to your specification - none of those $2 values represent the "same path upto 5 dir levels". The first entry...
294
Posted By RudiC
Do I get you right that the new bar code string...
Do I get you right that the new bar code string is in a file called failed_list_check and should be tested for existence in a "history" file failed_list, and, if found, send a mail? If so, try
grep...
167
Posted By RudiC
Well, yes, I noticed the necessary removal of...
Well, yes, I noticed the necessary removal of $20. So NF-- would remove it (if it is the last field). What is the trailing NF for?


And, why $20 when your entire file has only 9 fields per line...
167
Posted By RudiC
Help me out: what does {NF--NF} do in your second...
Help me out: what does {NF--NF} do in your second awk script do? An uncommon construct, at least to me...

For your problem, how about
awk -F"\t" '
NR > 2 &&
($5-$4) > 200 &&
$3...
424
Posted By RudiC
What's happening? What doesn't work? Any errors /...
What's happening? What doesn't work? Any errors / messages / misbehaviour?
300
Posted By RudiC
A short but proper description the entire...
A short but proper description the entire situation (how the script is called, what the positional parameters stand for, how parfile and test_10062019.par relate) would help people understand the...
416
Posted By RudiC
That depends. Do the commands read from stdin?...
That depends. Do the commands read from stdin? Are those commands' user prompts always in the same order, and always of the same length? If none of these, it might become difficult, unless a command...
387
Posted By RudiC
Try unescaped: grep "'test" file ...
Try unescaped:
grep "'test" file
'test
383
Posted By RudiC
The logics are OK, but the syntax is not: - and...
The logics are OK, but the syntax is not:
- and is not a shell keyword; try -a (although deprecated)

- FILE_SIZE will not be expanded; use with $ sign

- > is being interpreted as an output...
454
Posted By RudiC
Please check your arithmetics for the SUM of...
Please check your arithmetics for the SUM of pat9.
I can't see where you comply with the specified weight of .25.


Tryawk -F, -vOFS=, '
NR == 1 {
$1 = sprintf ("%-25s", $1)
...
Showing results 1 to 25 of 500

 

Featured Tech Videos

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