Search Results

Search: Posts Made By: Scrutinizer
61,508
Posted By Scrutinizer
Hi Sea, The behaviour of printf and echo are...
Hi Sea,

The behaviour of printf and echo are different.

$ echo This is piped
This is piped
and
$ echo "This is piped"
This is piped

produce the same output*, but this is not the case...
43,688
Posted By Scrutinizer
grep -E '^filename-([0-9]+\.){3}tar\.gz' file
grep -E '^filename-([0-9]+\.){3}tar\.gz' file
2,469
Posted By Scrutinizer
The caret sign (^)means that the expression only...
The caret sign (^)means that the expression only matches text at the beginning of the line.
There already had be a space at the end.
These two measures make that a partial match will not work.
2,469
Posted By Scrutinizer
Hi, try: grep "^${disk1} " -o...
Hi, try:
grep "^${disk1} " -o --max-count=1
2,812
Posted By Scrutinizer
Try: awk -F, '$3=="bcd"{$0=$0 FS...
Try:
awk -F, '$3=="bcd"{$0=$0 FS substr($NF,4,1)}1' file
4,756
Posted By Scrutinizer
Do you mean the Network Information Service...
Do you mean the Network Information Service schema for LDAP?
RFC 2307 - An Approach for Using LDAP as a Network Information Service (https://tools.ietf.org/html/rfc2307)
and
Or perhaps the...
5,050
Posted By Scrutinizer
Explanation
You're welcome..

Awk is somewhat unique in the sense that it allows you to specify a different record separator, other than the typical newline, which is absent in your case.

By specifying a...
5,050
Posted By Scrutinizer
Unix utilities typically need a linefeed at the...
Unix utilities typically need a linefeed at the end of the line. You could try awk:

awk '/test12-42213.devserver.com/,/EndTime/; END{printf "\n"}' RS=, ORS=, file
or
awk -v...
2,326
Posted By Scrutinizer
Why single line? Another croc to try: awk...
Why single line? Another croc to try:
awk 'NR>2{e="N"; exit 1} END{printf "##### THE LOTC cluster state IS %sOK ##########\n",e}' file
4,823
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...
1,727
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.
3,383
Posted By Scrutinizer
Hi, it does not work that way. Instead try: ...
Hi, it does not work that way. Instead try:
oflnb=${oflna%.*}
23,630
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...
3,749
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...
3,749
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? 02-13-2020
7,401
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...
13,537
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=...
4,999
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.
2,900
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...
2,900
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...
3,223
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)
19,080
Posted By Scrutinizer
Hi, a pipe appears to be missing: egrep -v...
Hi, a pipe appears to be missing:
egrep -v '^listener' |\
6,910
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...
1,856
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.
3,576
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
...
Showing results 1 to 25 of 500

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