Search Results

Search: Posts Made By: RudiC
36
Posted By RudiC
How about echo /dir1/dir2/dir3/$(date...
How about
echo /dir1/dir2/dir3/$(date +"%Y/%m/%d")/init* | wc -w
191
Posted By RudiC
A little clumsy as you have to take care for...
A little clumsy as you have to take care for every single special case - may benefit from some polishing:
awk '
BEGIN {PAT = "<<[^>]*>>"
}

{match ($0, PAT)
NXT =...
191
Posted By RudiC
Try also awk ' BEGIN {PAT = "<<[^>]*>>" ...
Try also
awk '
BEGIN {PAT = "<<[^>]*>>"
}

{match ($0, PAT)
NXT = RSTART + RLENGTH
while (0 < getline T1[++CNT1] < (substr ($0, RSTART+2, RLENGTH-4)) );
...
233
Posted By RudiC
Well, then, try TMP=$(find /where/so/ever...
Well, then, try
TMP=$(find /where/so/ever -iname "*bootstrap*"); case ${TMP##*_} in (green) echo "is green";; (red) echo "is red";; (*) echo "is missing";; esac


You could, of course, also use...
180
Posted By RudiC
I'd trust the system when it complains a file not...
I'd trust the system when it complains a file not residing where it looks for it.
Did you make very sure that file exists?


What happens in your script is that bash's mapfile / readarray builtin...
233
Posted By RudiC
Do the two file versions coexist, or is there one...
Do the two file versions coexist, or is there one single file max?
And, why a one liner? What be the benefit thereof?
191
Posted By RudiC
Any attempts / ideas / thoughts from your side?
Any attempts / ideas / thoughts from your side?
155
Posted By RudiC
Please take care when formulating your request....
Please take care when formulating your request. Misleading specifications may lead to unsatisfactory proposals.





Try
if ls "$dir"/[Ff]ile[Oo]ne.csv > /dev/null 2>&1
then echo "File...
110
Posted By RudiC
I get the same results as you do applying your...
I get the same results as you do applying your script to your sample data. But, not knowing WHAT formula to apply under which conditions, I can't tell "what (you're) ... doing is right." And, I'm...
155
Posted By RudiC
Don't understand. Above will echo "File not...
Don't understand. Above will echo "File not found!" if any file name beginning with fileone.csv exists in dir, like
fileone.csv
fileone.csv12
fileone.csvacbdefaj
fileone.csv_sdfwegf If none of...
336
Posted By RudiC
Do the files exist? Did you adapt the filenames?...
Do the files exist? Did you adapt the filenames? You gave this in post #1:
336
Posted By RudiC
awk -F, ' FNR == 1 {FCNT++ ...
awk -F, '
FNR == 1 {FCNT++ # inc file counter with every new file
}
FNR > 1 ...
246
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
207
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...
336
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...
248
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...
248
Posted By RudiC
Any attempts / ideas / thoughts from your side?...
Any attempts / ideas / thoughts from your side? Applying what you learned in here?
259
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
259
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
...
262
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...
521
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 [ !...
318
Posted By RudiC
Might be a candidate for the pkill command?
Might be a candidate for the pkill command?
267
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...
272
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...
521
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...
Showing results 1 to 25 of 500

 

Featured Tech Videos

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