I have a very 'dirty' bash script that is working and looks like this:
Most of the times I do not know the value for "n", how can I modify the script in such way that even if I do not know the number of files in that particular folder I will be still able to process them?
Other little thing, I am pretty sure there should be a way to 'clean' the script to make it look "cleaner".
Any help will be greatly appreciate it!
Calculating matrix distances and generating a tree
Franklin52,
Let me try to explain what I am trying to accomplish. I have hundreds of files named "block1", "block2", etc; containing DNA sequences in Phylip format. I want to calculate the genetic distance for each "block" file using the binary program "dnadist" which uses D (Kimura) and Y (YES) as options. Unfortunately, "dnadist" won't let me use anything as an input but a file named "infile". Thus, I start my script by renaming the files from "blockX" to infile and then feed it into dnadist. The output file that is generated by "dnadist" is bydefault "outfile" and I cannot change the file name either. I just came to realize that I do not need to "temporarily" rename the "outfile" to "ResultX" but instead to "infile", therefore I can delete that part. Finally, I grab the "new" "infile" and process it using "neighbor", using Y (YES) as option, in order to generate the corresponding trees. "neighbor" generates two different files "outfile" and "outtree", I only need the "outtree" file, which I rename as "ResultX", and that' why I just need to delete the "outfile". Then, we process the next file "block2" and the cycle starts again.
As I said, many times I do not know the number of "block" files in my folder, and therefore I would like to modify my script to be able to process whatever number of files, it can range from some few to several hundreds, are present in that given folder.
So, the my script now looks something like this:
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
I have the following script:
awk -F "," '{ if ( $4 > 450 && $4 < 550 && $5 > 0.5 ) print $2, $5; else print $2, "0" }' test.txt | awk '{a+=$2}END{for(i in a){print i, a}}' | sort -nk 1.2 | sed 1,2d
and a bunch of files that look like the test file attached here.
I am outputting all... (2 Replies)
Hi!
I am trying to compile a C++ code with cmake and gcc on Ubuntu. The code uses NetCDF4 libraries. I specify the path to these libraries as follows:
-I/usr/local/include -L/usr/local/lib -lnetcdf -lnetcdf_c++4
"ccmake" and "cmake" work fine. After typing "make" I receive the error... (0 Replies)
Hi,
I am running a perl script to automate a process and I keep running into a error can't find the "value"
Can't call method "value" on an undefined value at process_file.pl line 44.
file is CVS
cell is ifdfdxrfmp.ksh
Here is the script I have also attached it as well:
... (2 Replies)
Hell all
I tryed to build rmp from sources on Solaris 10. I download source code, install gcc, binutils, and other packs с sunfreeware.com.
Doring compilation I got an error:
/bin/bash ./libtool --tag=CC --mode=link gcc -std=gnu99 -g -O2 -fPIC -DPIC -D_REENTRANT -Wall... (0 Replies)
i am compiling a program called vasp on suse and get the following error. there are many more preprocess and ifort commands prior so i just grabbed the tail of the log file:
./preprocess <main.F | /usr/bin/cpp -P -C -traditional >main.f90 -DMPI -DHOST=\"LinuxIFC\" -DIFC -Dkind8 -DNGZhalf... (6 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Hi,
haven't found anything about this through searching, so may be a new topic:
when doing this:
set -o nounset
set -o errexit
find . -name "*.lib" | while read library; do
echo ${libary}
done
echo "after while"
I expect the script to exit within the while loop (because of nounset and... (6 Replies)
Hi,
I am using xlC compiler. The compilation goes fine but at the time of linking it gives the following error
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
ld: 0711-317 ERROR: Undefined symbol: .u_strlen_2_6
ld: 0711-317 ERROR: Undefined symbol:... (0 Replies)
Didn't have this problem in AIX, but ported to Linux with GCC compiler and am now getting a runtime error:
tssutil: symbol lookup error: /work/agility/devel/bin/libagam.so: undefined symbol: fstat
I'm sure most of you know that fstat is an intrinsic function just like printf, memcpy, etc. When I... (5 Replies)