Search Results

Search: Posts Made By: RudiC
74
Posted By RudiC
Difficult to believe. Any error messages? is dir...
Difficult to believe. Any error messages? is dir exported / defined (within the script)?


Try also
stat -c"the current csv is from: %y" *.csv | sort -r -k6,6 | head -1
76
Posted By RudiC
It's not the for cycle's feature but the way the...
It's not the for cycle's feature but the way the shell expands the "glob"s using "pattern matching". man bash is your friend:

For any other arrangement of the value list, additional measures...
122
Posted By RudiC
How about awk -F, ' FNR == 1 {FCNT++ ...
How about
awk -F, '
FNR == 1 {FCNT++
}
FNR > 1 {KEYS[$1]
for (i=2; i<=NF; i++) W[$1,FCNT,i] = $i
}
END {printf...
100
Posted By RudiC
For the easy case that your replacements are in...
For the easy case that your replacements are in lines in increasing order, try
awk 'FNR==NR {REP[NR] = $2; next} /^>/ {$0 = ">" REP[++CNT]}1' FS="=" list.txt gene1.fasta
>org5
ATGTAGC
>amylase...
100
Posted By RudiC
Any attempts / ideas / thoughts from your side?...
Any attempts / ideas / thoughts from your side? Applying what you learned in here?
131
Posted By RudiC
man diff: If your OS / shell...
man diff:





If your OS / shell don't offer "process substitution", try also:
sed 's/^# file.*/&\n\n&\n/' file2 | diff -y -b --suppress-common-lines - file1
131
Posted By RudiC
How far would $ diff -y -b...
How far would
$ diff -y -b --suppress-common-lines file1 <(sed 's/^# file.*/&\n\n&\n/' file2)
>
> # file: /local/test_1
...
144
Posted By RudiC
man awk: The match searches $0 for your...
man awk:

The match searches $0 for your target string PCX..._1 (the ellipsis replaced by [^_]*, i.e. non-"_" characters), and, if found, sets RSTART and RLENGTH accordingly for immediate use by...
368
Posted By RudiC
Hmmm - I missed to post the necessary IFS...
Hmmm - I missed to post the necessary IFS modification. Try again with this slightly modified version:
IFS=$'\n'

for IN in $(echo "${!ENTRIES
}" | tr ',' '\n' | sort -un)
do [ !...
188
Posted By RudiC
Might be a candidate for the pkill command?
Might be a candidate for the pkill command?
128
Posted By RudiC
There seems to be a mixup between shell globs and...
There seems to be a mixup between shell globs and grep / regex patterns. Try grep 'body.*.xml'.


Or, recent bashes provide "extended pattern matching" if the extglob shell option is set:
shopt...
134
Posted By RudiC
My personal first step is always to consult the...
My personal first step is always to consult the relevant man pages. bash provides "arithmetic expansion" / "arithmetic evaluation". man bash:





As it provides integer calculations only, we...
368
Posted By RudiC
It does, as you can see in my post. - What's...
It does, as you can see in my post.
- What's your result with the array shown in post #1?
- What exactly does your array look like (index / element)?
- What's yoour bash version?
Run the code...
107
Posted By RudiC
As you didn't provide your OS (and its...
As you didn't provide your OS (and its confinements), try
find /app/testing/ -mtime +30 -type f -printf "%s %p\n" | sort -nr
144
Posted By RudiC
How about awk '/PROTOBUF_DIRS/ && match ($0,...
How about
awk '/PROTOBUF_DIRS/ && match ($0, /PXC[^_]*_1/) {print substr ($0, RSTART, RLENGTH)}' *.spec *.mkawk unfortunately lacks both the -r (--recursive) and the --include options that grep...
285
Posted By RudiC
What results would you expect for "Jim",...
What results would you expect for "Jim", "Homework", or "Pam", "Quiz", with your sample data in post #1?
188
Posted By RudiC
man kill: Your shell may have...
man kill:





Your shell may have its own version of kill which may behave slightly different; pls. verify upfront.
285
Posted By RudiC
I'm afraid, no. You've been shown in your other...
I'm afraid, no. You've been shown in your other thread (https://www.unix.com/303040608-post2.html) that division by 0 is possible in your context and the reason therefor. And, looking at your sample...
301
Posted By RudiC
Sorry - I meant scenario 2 in my former post. For...
Sorry - I meant scenario 2 in my former post. For your scenario 1, try


echo "${STRING//,/$'\n'}" | awk -F: '
FNR==NR {T[$1,$2] = $0
next
}
($1,$2) in...
368
Posted By RudiC
man hosts: Guessing ENTRIES is your...
man hosts:



Guessing ENTRIES is your array, how far would this get you:
for IN in $(sort -u <<< $(echo "${!ENTRIES
}" | tr ',' '\n'))
do [ ! "${IN/[A-Z]}" = "$IN" ] && break
...
215
Posted By RudiC
Pls post a hexdump of your input file.
Pls post a hexdump of your input file.
368
Posted By RudiC
What bug? pls describe / explain. ...
What bug? pls describe / explain.


Array used for what?


The element count per leading number seems to vary?


The hosts file doesn't come from the array above?



What...
195
Posted By RudiC
I don't think switching to awk will speed up...
I don't think switching to awk will speed up things dramatically if at all, as it won't be faster than the designed-for-the-task split command. In either case you'll need to scan through the entire...
132
Posted By RudiC
Please answer the questions raised by Peasant. ...
Please answer the questions raised by Peasant.



All sed command operate on the pattern space; hold space is just a bucket for intermediate storage. Your code snippet swaps the line just read...
269
Posted By RudiC
Your approach might work; its ramifications...
Your approach might work; its ramifications aren't fully clear to me. rming $7 does not necessarily target the correct, intended file; with 8 files it will delete yesterday's file as they are set in...
Showing results 1 to 25 of 500

 

Featured Tech Videos

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