Search Results

Search: Posts Made By: Scrutinizer
450
Posted By Scrutinizer
awk '/Start/{p=$0; next} p{p=p ORS $0}...
awk '/Start/{p=$0; next} p{p=p ORS $0} /End/{if(p~/12345/)print p; p=x}' file

Or, using vertical real estate:
awk '
/Start/ {
buffer=$0
next
}
buffer {
buffer=buffer ORS...
173
Posted By Scrutinizer
You need to use double quotes, rather than single...
You need to use double quotes, rather than single ones in this case. Shell variables inside single quotes do not get expanded.
223
Posted By Scrutinizer
Hi, it does not work that way. Instead try: ...
Hi, it does not work that way. Instead try:
oflnb=${oflna%.*}
986
Posted By Scrutinizer
Not sure if this applies here. One time I came...
Not sure if this applies here. One time I came across a excessive load pattern with no increase of cpu and io, was when there were a lot of processes in uninterruptible sleep state (D), which...
366
Posted By Scrutinizer
Ah I see OK By the way I suggested "%6s"...
Ah I see OK

By the way I suggested "%6s" rather than "%6d" to avoid the octal thing...
366
Posted By Scrutinizer
A quick note to add: numbers=$(printf "%6s"...
A quick note to add:
numbers=$(printf "%6s" $number)
numbers=${numbers// /0}
could also be combined as:
numbers=$(printf "%06s" "$number")
Forum: What is on Your Mind? 1 Week Ago
585
Posted By Scrutinizer
Thank Neo, for this great honour and your kind...
Thank Neo, for this great honour and your kind words!

I agree that there are many who deserve this title and I feel honoured to be among them..

I am glad to be part of this wonderful community...
413
Posted By Scrutinizer
Try this adaptation of RudiC's suggestion: ...
Try this adaptation of RudiC's suggestion:

awk '
/@inlineifset/ {
if(/@btpar/) {
$1 = $1
gsub(/@inlineifset{mrg, @btpar{@|,,,,}}/, "")
}
print
}
' RS=...
416
Posted By Scrutinizer
Using RudiC's suggestion of -M , using GNU sort ...
Using RudiC's suggestion of -M , using GNU sort
sort -k4n -k1,1M -k2,3n file
Would complete the sort.
369
Posted By Scrutinizer
Good to hear the suggestion seems to work out for...
Good to hear the suggestion seems to work out for you :)
Let me explain what it means:
while ( ytd_date !~ /^[01][0-9][0-3][0-9][901][0-9]$/ ) {
This is a so-called "regular expression" , which...
369
Posted By Scrutinizer
Hi, Try changing: while ( ytd_date !~...
Hi,

Try changing:
while ( ytd_date !~ /^[01][0-9][0-3][0-9][901][0-9]$/ ) {
into
while ( ytd_date !~ /^[01][0-9][0-3][0-9][0-9][0-9]$/ ) {
and try and test if that might work out for you...
284
Posted By Scrutinizer
To get just the filename you can use ${f##*/}...
To get just the filename you can use ${f##*/} instead of $f (within double quotes)
Forum: Shell Programming and Scripting 2 Weeks Ago
406
Posted By Scrutinizer
Hi, a pipe appears to be missing: egrep -v...
Hi, a pipe appears to be missing:
egrep -v '^listener' |\
664
Posted By Scrutinizer
Hi some quick thought on the last code snippet: ...
Hi some quick thought on the last code snippet:
In awk the middle section is processed per line, so you should leave out:
for(i=1;i<=NR;i++)
The results should be stored in arrays so they can be...
434
Posted By Scrutinizer
Can you specify what does not work? The message...
Can you specify what does not work? The message presented is just a warning caused by the unnecessary backslash before the semicolon, but it should not change the outcome.
529
Posted By Scrutinizer
Here are some more alternatives to try: Use...
Here are some more alternatives to try:

Use a here string
read var1 var2 <<< "$(openstack hypervisor stats show | awk -F'|' 'NR==14{print $2,$3}')"
Use a here document
read var1 var2 << EOB
...
538
Posted By Scrutinizer
Try: xargs -n3 < file You can experiment by...
Try:
xargs -n3 < file
You can experiment by varying the number and see what it does.
Forum: Shell Programming and Scripting 2 Weeks Ago
476
Posted By Scrutinizer
There is a syntax error in the awk code: if(...
There is a syntax error in the awk code:
if( substr($0,1,1) == comment || if( substr($0,1,2) == comment )
should probably be
if( substr($0,1,1) == comment || substr($0,1,2) == comment )
416
Posted By Scrutinizer
To keep the forums high quality for all users,...
To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read...
538
Posted By Scrutinizer
Hi, What OS and version are you using? ...
Hi,

What OS and version are you using?
What does your file look like?
What is the exact message?
213
Posted By Scrutinizer
Hi, Looking at this snippet: xyz="$abc" ...
Hi,

Looking at this snippet:
xyz="$abc"
status=$?
$? will always be true (0) since the previous command is xyz="$abc" which is a variable assignment, which will always be successful..
Forum: Shell Programming and Scripting 3 Weeks Ago
244
Posted By Scrutinizer
And what is the command?
And what is the command?
Forum: Shell Programming and Scripting 3 Weeks Ago
244
Posted By Scrutinizer
What is your OS and version. Can you show the...
What is your OS and version.
Can you show the exact command?
Forum: Shell Programming and Scripting 3 Weeks Ago
244
Posted By Scrutinizer
Classes like [:ascii:] and [:word:] are non-POSIX...
Classes like [:ascii:] and [:word:] are non-POSIX additional classes that can be found in perl, but are not recognised by standard sed.

Instead of [:ascii:], with GNU sed you could try a regex...
320
Posted By Scrutinizer
If I do this : grep -E 'System Capabilities:...
If I do this :
grep -E 'System Capabilities: |System Desc' output.txt
Then I get:
System Description:
System Capabilities: B
System Description:
System Capabilities: B
System Description: ...
Showing results 1 to 25 of 500

 

Featured Tech Videos

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