Search Results

Search: Posts Made By: RudiC
249
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.
400
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...
Forum: Shell Programming and Scripting 2 Weeks Ago
548
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...
502
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 >...
560
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...
342
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/...
502
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...
328
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
Forum: Shell Programming and Scripting 4 Weeks Ago
1,236
Posted By nezabudka
Hi What about 'sed'? sed -r...
Hi
What about 'sed'?
sed -r 's%^[^-]*-(.*)-.*/(.*)/.*$%\1 \2\n&%' file
Forum: Linux 4 Weeks Ago
895
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...
1,480
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}.
1,005
Posted By nezabudka
Speed increased 5-10 times! 6GB single line...
Speed increased 5-10 times!

6GB single line file completely froze the system
629
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=" "
636
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.
1,472
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...
815
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.
848
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?
1,472
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}
662
Posted By rdrtx1
awk -F, 'v[$1,$2] &&...
awk -F, 'v[$1,$2] && ($8-v[$1,$2])>1;{v[$1,$2]=$8;}' file
2,344
Posted By Aia
Hi Lord Spectre Please, review how you have...
Hi Lord Spectre

Please, review how you have executed the code from post #4. Based on your input it should have given you the desired output instead of no output as you mentioned.

Here's another...
859
Posted By nezabudka
Hi Maybe this will help? ss -t -o state...
Hi
Maybe this will help?
ss -t -o state established

--- Post updated at 16:07 ---

ss -t -o state connected
ss -t -o state synchronized
1,887
Posted By MadeInGermany
Can be done as a { } group. (Note: there must be...
Can be done as a { } group. (Note: there must be a semicolon or newline before the closing brace! And of cause spaces next to the [ ] { } )
if [ -f ./file2 ] && [ -f ./file3 ] && { [ -f ./file1 ]...
2,098
Posted By rbatte1
One line sed option
How about using a single line sed like this:-sed "s/^C\( CALL.*'\(Gmax\|Gmin\|HS10\|HS2\|HS9\|Hmax\)'.*\)/\1/" source_file_name > target_file_name

It's a little messy to read, so:-

The s...
821
Posted By rbatte1
This is telling you that the value for pday is...
This is telling you that the value for pday is not set or not an integer, so your command as a whole becomes invalid. Could you sh -xv rmAgingFile.sh file*.log 2 and review the output to see what is...
1,006
Posted By vgersh99
be careful... some awk's don't have NR available...
be careful... some awk's don't have NR available in the END block. Just reassign NR to nr in your "main" block and use it in the END.
Showing results 1 to 25 of 500

 

Featured Tech Videos

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