Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suggestion: mention escape character #75

Closed
KamilSJaron opened this issue Jan 5, 2017 · 7 comments
Closed

suggestion: mention escape character #75

KamilSJaron opened this issue Jan 5, 2017 · 7 comments

Comments

@KamilSJaron
Copy link

The only feature of make not mentioned in this great tutorial that I found useful so far is the escape character $ for bash/awk oneliners. For instance an extracting a column of a text file using awk requires in bash command like awk '{print $1}', but $ symbol have to be escaped in make by another $, so the correct form in make is awk '{print $$1}'. It is also useful to access environmental variables.

I think this could be explained in 06-variables.md and would not take more than 5 minutes. I you think it as a good idea, I can try to make a pull request...

nxg pushed a commit to supa-uk/swc-make-novice that referenced this issue Jan 18, 2017
@gcapes
Copy link
Contributor

gcapes commented Jan 31, 2017

Thanks for the suggestion. I think maybe extras/discussion.md would be a suitable place for this, rather than adding it to episode 6.

@bernhold
Copy link
Contributor

I created PR #83 in an attempt to address this issue. Feedback would be welcome.

(This is for instructor-training)

@KamilSJaron
Copy link
Author

KamilSJaron commented Apr 13, 2017

@bernhold well done. I actually did not know that you can use ${VAT} as well.

I would probably still call the escape of a dollar sign "escape" rather than "quote" dollar sign simply because the most of the people learning make know bits of bash already, therefore they most likely know the concept of escaping (like spaces in folder names etc).

@bernhold
Copy link
Contributor

bernhold commented Apr 13, 2017

Thanks!

I used the terminology I found in the GNU Make manual, but I have no problem changing it if there is a consensus for "escape" instead.

Although one slightly tricky thing is that escapes in bash are pretty uniformly the backslash character, while in this case they are not. But of course it is the same concept. So either way, as far as I'm concerned.

@KamilSJaron
Copy link
Author

Interesting. I have never spotted this "quote" terminology before, but indeed in make manual they use it a lot. Then maybe it would be good just to mention something like "The quoting using $ follows same principle as escaping by character \ in bash.".

It is hard to me to judge what is consensus. However, when I would see such a paragraph I would wonder what is the difference to escaping.

@bernhold
Copy link
Contributor

Updated PR #83 to address your suggestion @KamilSJaron

@gcapes
Copy link
Contributor

gcapes commented Jun 13, 2017

#83 Fixes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants