Search Results

Search: Posts Made By: yifangt
Forum: Programming 01-18-2020
33,407
Posted By GRMartin
No, they are not at all the same thing. An...
No, they are not at all the same thing. An archive is just that. A collection of object files that can be statically linked to your executable. Shared objects are dynamically linked at runtime. They...
Forum: Programming 01-17-2020
33,407
Posted By Neo
Just because a liib is updated ... you do not...
Just because a liib is updated ... you do not have to recompile at all if your static binary is working fine.

In addition, shared libs can introduce major IT security issues.

There is "No Free...
Forum: Programming 01-17-2020
33,407
Posted By GRMartin
rpath is actually a linker option rather then a...
rpath is actually a linker option rather then a compiler option. gcc passes it to ld.



Well, th estandard way to use shared objects (.so) is to install them in the system directories used for...
Forum: Programming 01-15-2020
33,407
Posted By GRMartin
If you link to a shared library intead of the...
If you link to a shared library intead of the archive it's a little more complicted. If the shared library isn't installed in a directory know to the loader then you need to tell it where to find it....
Forum: Programming 01-15-2020
33,407
Posted By GRMartin
No. Each folder requires a -L entry. ...
No. Each folder requires a -L entry.






I presumed htslib-1.10-2 was your library. The -l option is for the library itself. If the library is libhts.so then use -lhts





I'll have a...
Forum: Programming 01-15-2020
33,407
Posted By GRMartin
Undefined references means the compiler can't...
Undefined references means the compiler can't find compiled code for functions being called. If you want to use a subset of the library then you'll have to compile and link all the files used by the...
Forum: Programming 01-15-2020
33,407
Posted By Neo
First, I suggest when troubleshooting, you...
First, I suggest when troubleshooting, you should:

Use the full path name to file, not relative path name. This will insure there are no strange, unseen PATH issues. For example:

gcc -Wall...
Forum: Programming 11-12-2019
27,183
Posted By DevuanFan
Thank you, Jim. That's a great tutorial. In...
Thank you, Jim. That's a great tutorial.

In case this helps other newbies, I moved the getstring function to a separate file containing custom functions. Also, I changed getstring's logic to go...
Forum: Programming 11-11-2019
27,183
Posted By apmcd47
realloc() is not guaranteed to reallocate in...
realloc() is not guaranteed to reallocate in situ, which is why you do
str = realloc(str, mem); rather than realloc(str, mem); The next_read variable should be reset with something like next_read =...
Forum: Programming 11-07-2019
22,919
Posted By MadeInGermany
BTW in many cases a trim function comes in handy....
BTW in many cases a trim function comes in handy.
For example, the fuzzy strstr() that can match a portion of the string can be replaced with an exact strcmp()
...
//...
Forum: Programming 11-07-2019
22,919
Posted By MadeInGermany
The empty line prints str1. Because it was not...
The empty line prints str1.
Because it was not matched in scanf() it has the value from the previous line - therefore the str1= assignment,
should set it to "" with one of
str1[0]=0 or...
Forum: Programming 11-05-2019
22,919
Posted By MadeInGermany
The str1 variable is too small. "sample10" is 8...
The str1 variable is too small. "sample10" is 8 characters, so str1 must have 8+1=9 bytes wide at least.
char name[256]; //1st part (key part) parsed from each line[]
char str1[12]; ...
Forum: Programming 11-04-2019
22,919
Posted By MadeInGermany
The code that you provided stops at line 8 with...
The code that you provided stops at line 8 with exit 1:
...
printf("%s: %s\n", name, str1); //puts() always adds newline at the end of the string
//printf("%d\n", i);
...
Forum: Programming 11-04-2019
22,919
Posted By MadeInGermany
For me it works: the red phrases land in the blue...
For me it works: the red phrases land in the blue variables.
But there can be trailing spaces in name because %[^:] matches up to the :
6,779
Posted By Don Cragun
1) It looks like vgersh99 has already shown you...
1) It looks like vgersh99 has already shown you how to expand shell variables for use in awk. Note, however, that his code will append to your two output files; not replace them if they already...
6,779
Posted By vgersh99
MY_DIR="/storage/tmp" awk -v myDir="${MY_DIR}"...
MY_DIR="/storage/tmp"
awk -v myDir="${MY_DIR}" '{if ($1 == "aaa") out=(myDir "/group_a.gtf"); else if ($7 == "bbb") out=(myDir "/group_b.gtf"); print >> out;close(out)} ' infile
8,237
Posted By Scrutinizer
awk version you could try: awk 'BEGIN{FS=RS;...
awk version you could try:
awk 'BEGIN{FS=RS; RS=">"; ORS=""} FNR>1{A[$1]=RS $0} END{for(i in A) print A[i]}' file1 file2

note: ensure that there are no excess trailing spaces as is the case with...
8,237
Posted By RudiC
May I paraphrase your request: You want file2's...
May I paraphrase your request: You want file2's sequences to prevail and file1's sequences inserted only if there's no equivalent in file2. If so, try
tr $'\n>' $' \n' <file1| grep -vf <(sed -n...
8,237
Posted By vgersh99
not sure if I follow your samples and the desired...
not sure if I follow your samples and the desired output, but I think you might want this.

awk -f dinesh.awk file2 file1 where dinesh.awk is:

FNR==NR {
if (FNR%2)
head=$0
else
...
8,187
Posted By Corona688
Parallel is not a go-faster button for files. ...
Parallel is not a go-faster button for files. Unless your CPU is maxing out, there's no benefit.

GNU parallel is just doing individual files like you were doing anyway. It has to, lacking magic...
8,187
Posted By bakunin
Actually this is a very interesting problem. It...
Actually this is a very interesting problem. It is hard simulate without actually create some terabytes of files that are similar in size to what you have to process, therefore, before i start to...
8,187
Posted By Don Cragun
How about something more like: ...
How about something more like:
LIST1=/what/ever/you/want
OUTPUT1=raw_reads_count.table1

while read -r f
do ( linecount=$(zcat ${f}_R1.fq.gz | wc -l)
printf '%s\t%s\n' "$f" "$linecount" >>...
8,187
Posted By RudiC
How about { echo -n $f" "; zcat ${f}_R1.fq.gz...
How about
{ echo -n $f" "; zcat ${f}_R1.fq.gz | wc -l; } >> raw_reads_count.table1 &
Should that fail, write to single files in sequence, then, after the loop, concatenate the files.
2,253
Posted By Corona688
Buffering will make a mess of this, bundling...
Buffering will make a mess of this, bundling arbitrary blocks into one write. These arbitrary blocks don't care much where lines begin and end. Long enough lines could conceivably take more than...
Forum: Programming 07-16-2018
2,900
Posted By Corona688
The risk of strcpy is this: char buf[8]; //...
The risk of strcpy is this:

char buf[8]; // Only room for 8 characters
char very_important_variable_touch_and_the_world_explodes=42;

// More than 8 characters, where does the rest go?...
Showing results 1 to 25 of 359

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