Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: RudiC
2,977
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} ./
4,190
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...
3,785
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)}'
2,214
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...
2,342
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 $*...
2,914
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* ]] && [[...
2,914
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.
8,809
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...
6,145
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...
1,527
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...
2,625
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 >...
1,333
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/...
1,755
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...
1,989
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
7,848
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
3,067
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...
3,598
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}.
2,508
Posted By nezabudka
Speed increased 5-10 times! 6GB single line...
Speed increased 5-10 times!

6GB single line file completely froze the system
1,650
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,100
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.
6,254
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,564
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,256
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?
6,254
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}
1,771
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 04:06 AM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy