Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
The problem statement, all variables and given/known data:
Write the a shell script program to remove all space characters stored in the shell variable TEXT. TEXT='onespace ,twospaces ,threespaces ,fourspaces ,'. Be sure to assign the results back to TEXT. Display the value of the TEXT variable to standard out. Do this using the tr command.
Relevant commands, code, scripts, algorithms:
tr
The attempts at a solution (include all code and scripts):
How do i go about writing a shell script program? If you can help me with that im hoping I can figure out how to answer the question.
Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
Calvin College, Grand Rapids MI, USA, Johnson, CO142.
Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).
Thanks so much for the reply. I guess im still quite confused by the question. Am I creating a file with vi called "TEXT" with the content of "onespace, ect.."?
Props to you Linux guys who understand this stuff. I feel so lost in this class. Thanks for the help.
From what you originally wrote, I'm pretty sure you need to write a shell script:
Write the a shell script program
In any case, it's better to use a shell script, because the problem has several steps.
So yes, you should use vi (or whatever editor you are comfortable with) to edit a file, and them submit your best guess here, and folks will give clues or help steer you in the right direction. Copy and paste from the file, and use the code tags, like I did above.
I would probably call the file tr_1.sh or something similar. Within the script, you will need to initialize the TEXT variable, remove the space characters from the variable, and then print out the variable.
To run the shell script, you'll need to set the file permissions correctly.