Search Results

Search: Posts Made By: RudiC
Forum: UNIX for Advanced & Expert Users 16 Hours Ago
96
Posted By RudiC
I don't think you can have a swiss army knife...
I don't think you can have a swiss army knife solution to a wild card problem. Please decently describe the data conents / structure in all cases, for every case, in detail. Are above the only three...
83
Posted By RudiC
Try also IFS="|" read -a A1 <file1 IFS="|"...
Try also
IFS="|" read -a A1 <file1
IFS="|" read -a A2 <file2
IFS=$'\n'
<<< "${A1
}$IFS${A2
}$IFS${A2
}" sort | uniq -u
B
D
E
G
H
STATUS
74
Posted By RudiC
Please become accutomed to supplying decent and...
Please become accutomed to supplying decent and sufficient information whereupon an analysis can be started. Like contents of the EXAMPLE variable, the (meaningful) code around that if construct,...
86
Posted By RudiC
Please become accustomed to supplying decent and...
Please become accustomed to supplying decent and sufficient information. "But it didn't work." is not a good starting point for an analysis beyond guessing. Is That file created at all? Is it empty?...
82
Posted By RudiC
Would the $BASHPID help? Like ps hocomm...
Would the $BASHPID help? Like
ps hocomm p$BASHPID
86
Posted By RudiC
Why not for ... do ... done >...
Why not

for ...
do ...
done > DAS_VetFed.txt
121
Posted By RudiC
Try adding a field separator after the publishing...
Try adding a field separator after the publishing year:
awk '{sub (/[0-9][0-9][0-9][0-9]\.@: /, "&|"); $1=$1} 1' RS= FS="\n" OFS=\| file | sort -t"|" -k3,3r -k4,4 | awk '$1=$1' FS="|" OFS="\n"...
130
Posted By RudiC
On top of what balajesuri already said, I don't...
On top of what balajesuri already said, I don't think {$run} will yield what you expect it to yield, but it also would not yield what you posted ( [5] ). I'd expect something like {5}, rather. Same...
76
Posted By RudiC
Would this do? grep ...
Would this do?
grep '^[^#]*Listen.*[^0-9]443\([^0-9]\|$\)' file
121
Posted By RudiC
Like so? awk '$1=$1' RS= FS="\n" OFS=\| file |...
Like so?
awk '$1=$1' RS= FS="\n" OFS=\| file | sort -t"|" -k3,3 | awk '$1=$1' FS="|" OFS="\n" ORS="\n\n"
142
Posted By RudiC
Try sed '/^PASS_MIN_LEN/c\PASS_MIN_LEN 12'...
Try
sed '/^PASS_MIN_LEN/c\PASS_MIN_LEN 12' /etc/login.defs
131
Posted By RudiC
Tryawk ' NR > 1 {for (i=5; i<=NF; i++) {n =...
Tryawk '
NR > 1 {for (i=5; i<=NF; i++) {n = split ($i, T, ",")
for (j=1; j<=n; j++) SUM += T[j]
$i = SUM/n
...
180
Posted By RudiC
I don't think either of a/src, b/src, or...
I don't think either of a/src, b/src, or x/y/dataLu/src is an absolute path; they all start downwards from your current working directory, $PWD.


Just in case neither the readlink nor the...
104
Posted By RudiC
Try ARRAY=($(ps -eo pid,etime,command | grep -o...
Try
ARRAY=($(ps -eo pid,etime,command | grep -o "\-Xmx[0-9M]*.\{,30\}/opt/rather/[^ /]*" | grep -o "\-Xmx[0-9M]*\|[^ /]*$" | tr "\n" " "))
echo ${ARRAY[@]}
-Xmx2048M bar -Xmx3002M raal
104
Posted By RudiC
With grep's greedy regex matching its not easy to...
With grep's greedy regex matching its not easy to lay hands on the activity if its "name is after "/opt/rather/". There may be better solutions than these ones that rely on the input lines'...
205
Posted By RudiC
What would you expect? The first greps the lines...
What would you expect? The first greps the lines with "done" in them and pipes it --- into nowhere! As the second opens the input file again to read from it and discards its stdin. You've been given...
205
Posted By RudiC
With grep and friends you'll get one count per...
With grep and friends you'll get one count per run, so you'll have to go through the file twice. Might not be a problem with small files, but resource consumption increases with sizes. Taylor your...
195
Posted By RudiC
Did you look into the helpful links at the bottom...
Did you look into the helpful links at the bottom of this page under "10 More Discussions You Might Find Interesting"?



Howsoever, for your first question, try


$ date --date='07/20/2019'...
149
Posted By RudiC
How far would this get you: awk '{TMP[$4]=$5;...
How far would this get you:
awk '{TMP[$4]=$5; VAL[$4]+=$7; CNT[$4]++} END {for (t in TMP) {i = t; gsub (/[:-]/, OFS, i); print i, TMP[t], VAL[t]/CNT[t]}}' OFS="\t" file
chr16 2097885 2097890 ...
280
Posted By RudiC
Difficult to believe cat \proc\pid\loginuid would...
Difficult to believe cat \proc\pid\loginuid would give any meaningful output (unless you're on a windows machine running some *nix emulator).
184
Posted By RudiC
Fine if that suits you. I was thinking you might...
Fine if that suits you. I was thinking you might want to perform further shell commands in the ifbranch...









Well, try if ! awk..., then. Or use the else branch...
280
Posted By RudiC
First thought: non-printing control characters in...
First thought: non-printing control characters in string.
184
Posted By RudiC
If "I am sure that pattern occurs only once" (per...
If "I am sure that pattern occurs only once" (per file, I presume), how about
if awk '/pattern/ {T[$2]++}; END {for (t in T) if (T[t] > 1) exit 1}' file[12]
then echo "Second column is not...
91
Posted By RudiC
Isn't that exactly what you wanted? In post #1?
Isn't that exactly what you wanted? In post #1?
91
Posted By RudiC
man bash (again) is your friend. What bash...
man bash (again) is your friend. What bash version do you have?
Showing results 1 to 25 of 500

 

Featured Tech Videos

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