Register
It is currently Fri Jul 25, 2014 5:19 am

script to identify and subtract numbers?


All times are UTC - 6 hours


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Mon Apr 14, 2008 5:26 am   

Joined: Mon Apr 14, 2008 5:07 am
Posts: 9
Hi,

I want to build a script that alters the origin in a plasmid. The plasmid is stored in a XML file, and is circular. The way I want to do it is to build a script that identifies all numbers in the file and subtracts a certain number from them that is a user input.
Furthermore, if the number after subtraction is less than zero, it should be added to another number (the totalt size of the plasmid) that is also a user input. For instance, if the original number is 4 and the subtaction is 6, the result is -2. The totalt size of the plasmid is 10, therefore the output should read -2+10=8.

Is this even possible with bash or should I try another scripting method?


Top
 Profile  
 PostPosted: Mon Apr 14, 2008 9:59 am   
Site Admin

Joined: Tue May 17, 2005 7:31 pm
Posts: 251
Location: Georgia
all things are possible with bash :wink:

since bash just uses outside programs to run tasks... if you are using math in bash... might be easier to invoke bc from within bash
but keep in mind... math isn't bash's strong point :wink:


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP