Search Results

Search: Posts Made By: MadeInGermany
12,186
Posted By MadeInGermany
A shell script with only shell builtins: ...
A shell script with only shell builtins:
#!/bin/sh
set -f # unquoted $f2
IFS=";"
while IFS="," read f1 f2
do
printf "$f1, %s\n" $f2
done < file
58,809
Posted By MadeInGermany
That globally suppresses all error messages. ...
That globally suppresses all error messages.
You can suppress them for specific commands only, for example
df -kP 2> /dev/null
Suppress the expected.
If unexpected things happen then error...
4,942
Posted By MadeInGermany
Here is one with awk: awk ' {...
Here is one with awk:
awk '
{ blevel+=gsub("[{]","&")-gsub("[}]","&") }
blevel<dlevel { del=0 }
del==0
$1~/^type=scythe/ { del=1; dlevel=blevel }
' goob

When it meets type=scythe it deletes...
11,605
Posted By MadeInGermany
Even without the shopt -s extglob the folllowing...
Even without the shopt -s extglob the folllowing is expanded: echo {*,*/*,*/*/*}.{opt,texi}
A shopt -s nullglob suppresses non-matching patterns.
11,605
Posted By MadeInGermany
grep -l prints the file names so you can process...
grep -l prints the file names so you can process them with xargs.
grep --include="*.org" --include="*.texi" -lir "Abstract" . | xargs headBut xargs has a problem with space characters in file names....
41,019
Posted By MadeInGermany
Yes 97 works, but not 10. The problem is that...
Yes 97 works, but not 10.
The problem is that the $( ) (likewise the ` `) strips a trailing newline; this is mostly for convenience.
x="
"; echo ${#x}
1
x=$(echo "
"); echo ${#x}
0


---...
6,678
Posted By MadeInGermany
I forgot that ( is special in ERE, that awk uses....
I forgot that ( is special in ERE, that awk uses. You found it: needs to be escaped. An alternative would be [(].

Each code line is a condition { action }.
All three code lines are run for each...
37,319
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...
6,678
Posted By MadeInGermany
Like the following shell command with embedded...
Like the following shell command with embedded awk script?
awk '
$2 != "=" { next }
$1 == "(SERVICE_NAME" && $3 ~ s { print a }
$1 !~ /^(/ { a=$1 }
' s="pri"
Forum: AIX 04-25-2020
42,458
Posted By MadeInGermany
I am not an AIX expert, but NFS is a standard - I...
I am not an AIX expert, but NFS is a standard - I guess IBM even licenced it from SUN.
The NFS version is "negotiated" once, at mount time. The client simply asks the server via rpcinfo what...
Forum: Solaris 04-23-2020
31,667
Posted By MadeInGermany
Thanks for the update. These hardware RAIDs...
Thanks for the update.
These hardware RAIDs ship with their own software. I wonder if Solaris provides a general frontend where they can plug in. (Like fbconfig, it was a frontend command for most...
7,116
Posted By MadeInGermany
The ls -lrth $SOURCEONEACTUAL | awk '{print...
The
ls -lrth $SOURCEONEACTUAL | awk '{print $9}'
can be simplified and improved (in case of a space in the file name):
ls -rt $SOURCEONEACTUAL

The
cd $SOURCEONEACTUAL
you better do once -...
5,740
Posted By MadeInGermany
You can try to embed your remote script in a here...
You can try to embed your remote script in a here document, then for faster processing store it in a variable.
scriptcode=$(
cat << "ENDSCRIPT"
echo "running on `uname -n`"
ps -fp `grep \`tail -1...
7,775
Posted By MadeInGermany
... that works in ksh93 and newer. ksh88...
... that works in ksh93 and newer.

ksh88 needs
b=$(printf "%.f" $a)
9,846
Posted By MadeInGermany
awk can do this during reading the input file -...
awk can do this during reading the input file - no need to store everything and process in the END section.
awk '$1~search {p=1} NF==0 {p=0}; p' search="NUMADDR" fileThe p variable controls when to...
6,541
Posted By MadeInGermany
Each character set [ ] matches one character ...
Each character set [ ] matches one character
find ~/ -name 'bin.000[0-9][0-9][0-9]'
10,257
Posted By MadeInGermany
crontab -l list. crontab -e edit with default...
crontab -l list.
crontab -e edit with default editor.
EDITOR=nano crontab -e edit with nano.
(crontab -l; echo '2 18 * * 0,2,4,6 find /tempr/DSC/PH[123]* \! -type d -mtime +3 -exec rm -f {} +') |...
10,257
Posted By MadeInGermany
Run on "even" weekdays at 18:02 2 18 * *...
Run on "even" weekdays at 18:02
2 18 * * 0,2,4,6 find /tempr/DSC/PH[123]* \! -type d -mtime +3 -exec rm -f {} \;
3,547
Posted By MadeInGermany
1. Could you please clarify? injest => ingest ...
1. Could you please clarify?
injest => ingest
normalize => sort ?

2. Could you provide a short example of your input data?

3. Could you provide your script trial?
If you run it on the...
54,387
Posted By MadeInGermany
That explains it; and your photo shows a...
That explains it; and your photo shows a non-ascii character.
It's not sufficient to sort out [a-zA-Z].

With an ERE you can ensure the input is a number:
[[ $NUM =~ ^[0-9]+$ ]] || continue
echo...
54,387
Posted By MadeInGermany
&2>/dev/null is still odd, the & is too many. The...
&2>/dev/null is still odd, the & is too many. The & before a descriptor number is needed on the RHS only, to distinguish it from a file name.
And, the only errors that a [[ ]] can produce are...
34,282
Posted By MadeInGermany
With two capture groups and back-references one...
With two capture groups and back-references one can insert a newline in the middle:
sed 's/\(.\)\(.:\)/\1\
\2/g'
Here I used the standard backslash-newline to represent the newline.
54,387
Posted By MadeInGermany
Consequently you should replace the other grep -E...
Consequently you should replace the other grep -E -q with a [[ =~ ]].

And &2>/dev/zero looks odd. Perhaps you mean 2>/dev/null but this is not appropriate after a [[ ]] compound.
2,234
Posted By MadeInGermany
If it arranged like this, two fields per line,...
If it arranged like this, two fields per line, then you can sort by field 2 numerically
sort -k2n records. txt
Pipe this to a tool that displays the first (head-1) or the last line (tail-1).
4,703
Posted By MadeInGermany
Check the process state (S column) with ps -flu...
Check the process state (S column) with
ps -flu xpinvoice
Are they in D state?
Showing results 1 to 25 of 500

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