Learning Special Characters
Hey guys, I need some help figuring out how to make bash not consider these special characters.
Here's the question: Exercise 1: Review the following file names and identify the special characters. Once you’ve identified the special characters, re-write the file name with the proper escaping of special characters.
For some reason this is super confusing to me, thanks in advance for the help! |
What is confusing?
Try breaking down your question into what specifically you are not understanding. Escaping? special characters? |
Quote:
For example, the first one, would it be \A\ \super\ \important\ \file\? I don't quite understand where the \ goes to cancel out each "Special character". |
Hi Hcardinal and welcome to LQ.
Please refer to our Welcome to LQ link for information about how to ask a more effective question. Be aware that if this is an assignment, it is not a problem posting questions about it, however assignment or not, our guidance is that you should indicate what you have personally tried, or offered more details similar to what you've done with your first follow-up. Meanwhile an LQ Rule is to not post assignments verbatim, which you appear to have done. You seem to be reading a lesson, be that for personal learning or as part of course. My experience is that prior to an exercise such as this, whatever the reading reference is, will inform you what special characters include. Therefore you should know if capital letters are considered special versus not. A: They are not. Since this is regular expressions and special character delimiters. A simple suggestion is to go to a Linux system, find a place which has at least one .txt file that does not have to have any of these strings and then try them out using grep: Code:
$ grep A super important file *.txt It complains about "super". It complains about "important". It complains about "file" It does not complain about "A" So try: Code:
$ grep A\ super\ important\ file *.txt |
Quote:
do your homework yourself, don't copy it down from your neighbor. you do have a bash shell to try things out, don't you? |
Shortcuts, will take you where you want to go easily.
But understanding the basics makes a solid ground. Try this link: https://www.shellscript.sh/escape.html Grab Linux installed it in a Virtual environment, and do the bash yourself. |
This is a good homework exercise, and you really do need to work through it yourself. :tisk:
These well-chosen examples are representative of things that you will encounter and that you will need to be able to do. There are no short-cuts. Don't shortchange yourself. If you don't entirely understand the question, go to your instructor(!) for clarification. This is the only way that your instructor will become aware that there is confusion concerning the question. Don't leave him/her in the dark: classroom learning needs the very active participation of both instructor and student. (Spoken by someone who's been in the front of the room ...) |
All times are GMT -5. The time now is 06:46 AM. |