LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   input and output strings separated by operators (https://www.linuxquestions.org/questions/linux-newbie-8/input-and-output-strings-separated-by-operators-927341/)

chanchong chau 02-03-2012 02:46 AM

input and output strings separated by operators
 
need clarification on relations on input and output strings separated by operators. liken it to learning basic grammar rules of a new language to enable one to move forward.

eehmke 02-03-2012 04:35 AM

Quote:

Originally Posted by chanchong chau (Post 4592552)
need clarification on relations on input and output strings separated by operators. liken it to learning basic grammar rules of a new language to enable one to move forward.

What language are you talking about?

chanchong chau 02-03-2012 05:03 AM

It is about bash as a starting point
 
the things I read about bash on the books were mostly about parsing string. So please base your reply on BASH. Thank you for enlightening people like me!

David the H. 02-03-2012 12:24 PM

Your question is very vague and hard to understand. If you have a specific example of what you want to do, please post it.

In general, Bash and other shells work by storing strings in variables, manipulating the contents in various ways, and then echoing them back out in your desired format. There are a large number of techniques available for doing all of these steps, and what to use depends on exactly what you need to do.

string manipulation


The nearest I can guess from your post is that possibly you want to break up a line/string based on some delimiter? If so, this is probably best done by reading the line into an array, using the IFS variable (or a similar delimiting function, depending on the technique used) to specify the character used for dividing the fields.

http://mywiki.wooledge.org/BashGuide/Arrays
http://mywiki.wooledge.org/BashFAQ/005

I also suggest reading through the bash guide here to get a better grasp on the basic scripting concepts.

http://mywiki.wooledge.org/BashGuide


All times are GMT -5. The time now is 01:25 PM.