Visit The New, Modern Unix Linux Community

Search Results

Search: Posts Made By: Scrutinizer
8,278
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...
10,681
Posted By Scrutinizer
grep -E '^filename-([0-9]+\.){3}tar\.gz' file
grep -E '^filename-([0-9]+\.){3}tar\.gz' file
1,052
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.
1,052
Posted By Scrutinizer
Hi, try: grep "^${disk1} " -o...
Hi, try:
grep "^${disk1} " -o --max-count=1
1,310
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
908
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...
2,747
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...
2,747
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...
937
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
1,564
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...
501
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.
1,744
Posted By Scrutinizer
Hi, it does not work that way. Instead try: ...
Hi, it does not work that way. Instead try:
oflnb=${oflna%.*}
7,315
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...
1,930
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...
1,930
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
3,353
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...
8,841
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=...
1,923
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.
1,649
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...
1,649
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...
1,725
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)
10,274
Posted By Scrutinizer
Hi, a pipe appears to be missing: egrep -v...
Hi, a pipe appears to be missing:
egrep -v '^listener' |\
3,048
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...
762
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.
1,736
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

 

Featured Tech Videos

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