Search Results

Search: Posts Made By: RudiC
5,032
Posted By nezabudka
Hi So, passed by ... grep...
Hi
So, passed by ...
grep --include=*.{org,texi}

--- Post updated at 22:03 ---


Maybe I misunderstood something
grep -hrm8 '.' --include=*.{org,texi} ./
7,795
Posted By MadeInGermany
When read indicates an EOF and the loop ends, it...
When read indicates an EOF and the loop ends, it still has read the last incomplete line into the variable.
So you can process it after the loop.
do_dirn(){
echo "dirn :$dirn"
}
printf...
8,654
Posted By vgersh99
How about: echo ${#text1} ${#text2} | awk...
How about:
echo ${#text1} ${#text2} | awk '$1*$2{a=b=$1;($1>$2)?a=$2:b=$2;print int(100/a*b)}'
5,852
Posted By Chubler_XL
<( list ) (process substitution) not available...
<( list ) (process substitution) not available is sh, your first example was probably using bash to run the script.

You could try this instead:

col_list='{print $64,$64,$52,$64,$64,$33}'
tail...
5,680
Posted By MadeInGermany
arr=("$@") Quotes around $@ (and ${arr[@]})...
arr=("$@")
Quotes around $@ (and ${arr[@]}) protect against word splitting and other substitutions, but still retain the list of argument members (and other array members).

In contrast, with $*...
3,977
Posted By MadeInGermany
In ksh88 (and bash) you can emulate f [[ ( $a...
In ksh88 (and bash) you can emulate
f [[ ( $a =~ sss[0-9]*$ ) ]]
with
if [[ $a == *sss* ]] && [[ ${a##*sss} != *[!0-9]* ]]
And
f [[ ( $a =~ ^sss[0-9]*$ ) ]]
with
if [[ $a == sss* ]] && [[...
3,977
Posted By MadeInGermany
Of course it is [[ $string2 =~ ROS[0-9]+$ ]]...
Of course it is

[[ $string2 =~ ROS[0-9]+$ ]] && echo OK || echo NOK
Minimum one digit.
13,229
Posted By vbe
tar: ./1043/B2KCOMP/b2kcomp/15002S10485964.70600...
tar: ./1043/B2KCOMP/b2kcomp/15002S10485964.70600 could not be archived
tar: ./1043/B2KCOMP/b2kcomp/15002S10879272.70598 could not be archived
tar: ./1043/B2KCOMP/b2kcomp/15002S11076030.70600 could...
12,238
Posted By nezabudka
Hello and welcome It's customary to help on...
Hello and welcome
It's customary to help on this resource, that is, you solve a problem and you don't succeed or you're stuck on something and don't know how to continue. Therefore, if you have a...
2,073
Posted By nezabudka
Hi, @RudiC sed -r...
Hi, @RudiC
sed -r 's/^([^,]*,){2}bcd,.*,(.){4}.*/&,\2/'
The marked greedy expression contains all the available fields except the last one,
which means that in the positions noted by you, the...
3,499
Posted By vgersh99
how about (a bit verbose): awk -f san.awk...
how about (a bit verbose):
awk -f san.awk myInputFile, where san.awk is:

BEGIN {
FS=OFS="\t"
i1=1
i2=2
v=3
}
function abs(x) { return x < 0 ? -x : x }

FNR>1 {
idx=($i1 >...
2,028
Posted By nezabudka
sed 'N;N;/5/ s/yes/no/' file sed...
sed 'N;N;/5/ s/yes/no/' file
sed '/^<alarmsend/{N;N;\%5</type>$% s/yes/no/}' file

--- Post updated at 13:44 ---

If you complicate the task as much as possible
sed -r '/^<alarm/...
2,492
Posted By RavinderSingh13
Hello shanul karim, Thank you for sharing...
Hello shanul karim,

Thank you for sharing your efforts in form of code in your question. Could you please do let us know more clearly what is the logic of getting the expected output. Honestly its...
2,629
Posted By nezabudka
Hi Try this ps --no-headers -eo...
Hi
Try this
ps --no-headers -eo "{\"'PID'\":\"'%p'\",\"'CPU_percentage'\":\"'%C'\"}"
and so on if you need add fields
9,032
Posted By nezabudka
Hi What about 'sed'? sed -r...
Hi
What about 'sed'?
sed -r 's%^[^-]*-(.*)-.*/(.*)/.*$%\1 \2\n&%' file
Forum: Linux 02-27-2020
4,579
Posted By sea
And here I come by thinking that swap nowadays...
And here I come by thinking that swap nowadays was used to save whats in the memory (ram) on hibernate/suspend.

At least on 'personal' machines that are not used as servers.

My 2 cents, please...
5,114
Posted By MadeInGermany
Nice solution :cool: For symmetry reason (and...
Nice solution :cool:
For symmetry reason (and the border case "empty input file") it should be END {printf DL}.
3,321
Posted By nezabudka
Speed increased 5-10 times! 6GB single line...
Speed increased 5-10 times!

6GB single line file completely froze the system
6,609
Posted By rdrtx1
grep name nameserver.txt | cut -d" " -f1,5...
grep name nameserver.txt | cut -d" " -f1,5 --output-delimiter="." | cut -d"." -f1,7 --output-delimiter=" "
2,751
Posted By Peasant
Have you tried running the grep -E -v...
Have you tried running the grep -E -v "string1|string2" and observe the results ?

Regards
Peasant.
7,972
Posted By Chubler_XL
You could use sed (or similar) to convert your...
You could use sed (or similar) to convert your input syntax to an awk expression eg:

CONDITIONS="(1=CT or 2=US_10) and 3=CT_US_10 and 4="
CONDITIONS=$(echo "$CONDITIONS" |
sed \
-e...
1,999
Posted By vgersh99
RudiC/rdrtx1, the binning, the percentage and...
RudiC/rdrtx1,
the binning, the percentage and the totals are somewhat different from the OP's desired output in post #1.
Hence post #2 with the ask to elaborate.
2,934
Posted By vbe
Yes, and depending of your knowledge of UNIX many...
Yes, and depending of your knowledge of UNIX many approaches and solutions...
What have you tried?
7,972
Posted By nezabudka
And where did you get the CONDITION variable in...
And where did you get the CONDITION variable in "awk"?

--- Post updated at 21:59 ---

Is a colon needed here?

maybe
{ if(strcondition(COND))print COND"|"$147"|"$15"|"$16"|"$17"|"$4}
2,877
Posted By rdrtx1
awk -F, 'v[$1,$2] &&...
awk -F, 'v[$1,$2] && ($8-v[$1,$2])>1;{v[$1,$2]=$8;}' file
Showing results 1 to 25 of 500

 

Featured Tech Videos

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