Search Results

Search: Posts Made By: RudiC
Forum: Shell Programming and Scripting 1 Minute Ago
34
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,...
46
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?...
Forum: Shell Programming and Scripting 26 Minutes Ago
26
Posted By RudiC
Would the $BASHPID help? Like ps hocomm...
Would the $BASHPID help? Like
ps hocomm p$BASHPID
46
Posted By RudiC
Why not for ... do ... done >...
Why not

for ...
do ...
done > DAS_VetFed.txt
Forum: Shell Programming and Scripting 4 Hours Ago
101
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"...
112
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...
Forum: Shell Programming and Scripting 6 Hours Ago
52
Posted By RudiC
Would this do? grep ...
Would this do?
grep '^[^#]*Listen.*[^0-9]443\([^0-9]\|$\)' file
Forum: Shell Programming and Scripting 12 Hours Ago
101
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"
126
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
118
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
...
139
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...
96
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
96
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'...
192
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...
192
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...
182
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'...
134
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 ...
268
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).
171
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...
268
Posted By RudiC
First thought: non-printing control characters in...
First thought: non-printing control characters in string.
171
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...
90
Posted By RudiC
Isn't that exactly what you wanted? In post #1?
Isn't that exactly what you wanted? In post #1?
90
Posted By RudiC
man bash (again) is your friend. What bash...
man bash (again) is your friend. What bash version do you have?
90
Posted By RudiC
Did you consider bash's -e option? man bash:
Did you consider bash's -e option? man bash:
610
Posted By RudiC
Try awk ' $3 == "transcript" {match...
Try
awk '
$3 == "transcript" {match ($0, /cov[ ".0-9]*;/)
split (substr ($0, RSTART, RLENGTH), T, "\"")
PR = (T[2] > 3)
...
Showing results 1 to 25 of 500

 

Featured Tech Videos

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