I have this shell script that I wrote to check an input file to see if it is empty or not, and then clean the file from any line that starts with the sign "<" (without quotation marks" and then spell the number of line of the file, and the empty lines, too. The script then will create two output files, DNA.out and RNA.out.
First I get an error message at that says:
but it gives me the results I want.
Here is the code:
After I get the two output files (DNA.out and RNA.out) I use another script to convert the contents of these two files into Amino Acids. The conversion script is:
This is how I use it:
where rna.sed is:
Now I want to know if I can put these two scripts together in one file and if possible to clean up the script.
My input file (sample) to be used with the first script (script.sh) is here:
to sum up what I do:
Which generates: DNA.out and RNA.out (with the error I mentioned), then:
where conversion.sh uses rna.sed
I hope I could make my questions clear and I appreciate your help.
Last edited by faizlo; 10-09-2015 at 05:15 AM..
Reason: minor edit
This one creates three files: DNA.OUT, RNA.OUT, and AminoAcids from the input file, and prints the numbers of non-empty and empty lines in the file:
I did NOT convert ALL of the RNA-Amino combinations from your sed file; should be easliy doable for you with the samples given...
Hello Faizlo
Your error:
is produced by comparing a string with an integer.
You probably wanted either: if [ -z "$1" ] (if its empty, show error)
or if [ ${#1} -eq 1 ] (if its just one string/word)
Can my scripts be combined together in just one script? My script gives the frequencies of each Amino Acid. Also, I ask to learn how to add a while loop in a script if it takes an input of its own.
I like my code to run in /tmp file when I am using a static files.
Consider trapping ( think that is what it called. Do a google) the file. So after checking that's the file exists with code above, follow up with ...
And then within test.txt. Have this line of code. Which also checks the file was placed in /tmp. Then runs your test.txt file.
This is called trapping and insure the program will stop running when it is completed. You can also run sub routines under the trap before running main code body.
.
.
.
Can my scripts be combined together in just one script?
Yes. Done.
Quote:
My script gives the frequencies of each Amino Acid.
.
.
.
That wasn't too clear from your spec. Try
Please note that there are several incomplete base triples in your file and that I did not cover all triples, just a few to prove the method working.
Okay I want to try my luck at fixing bugs for the Fedora OS, but I guess this question deals with any Linux distro or any open source OS for that matter.
I want to know how I can start fixing bugs on the OS level. For example the particular bug that I want to target is this logout bug
I mean... (6 Replies)
can someone please help me spot and fix the issue with the following code:
awk -F, -v SEARCHPATT="(Wed|Tue)" -v ADDISTR="Mon|Tue|Wed|Thu|Fri|Sat|Sun" -vVF="$VALFOUND"
"BEGIN{ {D = D = 1
D = D = 2
}
$0 ~ "," VF "," {L = 1 ... (9 Replies)
Hey guys,
I am trying to make print a pattern with * on a 10*10 two dimensional array in a for loop and I want the incoming 10*10 to overlap the previous 10*10 so that the * look like it is moving. is there a way to fix the screen position?
ever time it prints a 10*10 the screen moves.
... (3 Replies)
Hi
I use Rapid 7 to check some servers ( AIX 5.3 ) for security problems. There are 2 problems I don't know to deal with
1.
Problem : TCP Sequence Number Approximation Vulnerability
Solution :
_Enable TCP MD5 Signature
2.
Problem : HTTP Basic Authentication Enable
Solution :
_ Use... (5 Replies)
1. The problem statement, all variables and given/known data:
I need help I get a variant of syntax errors when compiling my script to maintain a database. It's a simple database meant to create/view/maintain vehicles.
2. Relevant commands, code, scripts, algorithms:
my if statements have... (5 Replies)
Hi Experts
I've problem in a my office server (solaris 10 - x86) version. x4600 M2 hardware
This system is getting rebooted because of zfs bug
I've applied patch using live upgrade with live new environment created and
applied the patch which oracle suggested(
144501-19), it asks for... (3 Replies)
Is there a way to fix the width of the word being printed to a file? I am trying to create an output to a file with columns , like a spread sheet. I have used "\t" to adjust the columns but still it does not show well in the file, mainly due to the variable length values in the column so \t does... (1 Reply)
I am trying to replace the value of $f3 but its not working . I don't know what I am missing here .
cat dim_copy.20080516.sql | grep -i "create view" | grep -v OPSDM002 | while read f1 f2 f3 f4 f5 f6 f7 f8 f9
do
echo " $f3 "
sed -e... (13 Replies)