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

練習2.1.e (p.61) の ~ のクォートについての記述は誤り #50

Closed
norioxkimura opened this issue Jul 31, 2022 · 5 comments
Closed

Comments

@norioxkimura
Copy link

norioxkimura commented Jul 31, 2022

PDF 版 2022/1/1 の練習2.1.e (p.61) に「ダブルクォートによるクォートの場合、中にあるBashの変数は解釈されます。また、変数だけでなく、ホームディレクトリを表す~などの特殊な記号も解釈されます。」とありますが、ダブルクォート中では ~(や *?)は展開されないと思います。

$ echo ~
/home/ubuntu
$ echo "~"
~
@ryuichiueda
Copy link
Contributor

ほんとですね・・・修正いたします。ありがとうございます!

@ryuichiueda
Copy link
Contributor

ryuichiueda commented Aug 1, 2022

とりあえず修正を掲示して、共著者に確認をお願いして、私は仕様をもう一度確認中です。

https://github.com/shellgei/shellgei160/blob/master/README.md#%E7%AC%AC4%E5%88%B7%E3%81%BE%E3%81%A7

@norioxkimura
Copy link
Author

norioxkimura commented Aug 2, 2022

p.113 「~ などのメタ文字について、特別な意味を打ち消してそのまま使いたい場合は、次のようにバックスラッシュ「\」でエスケープするか、もしくはシングルクォート「'」でくくる必要があります。」
→ ダブルクォート " でも問題ない。「メタ文字」の $ \ などは "" 中でもエスケープが必要で、'' なら問答無用にその文字自身になるという意かな?

@ryuichiueda
Copy link
Contributor

お、こちらもありがとうございます。修正します。

@ryuichiueda
Copy link
Contributor

https://github.com/shellgei/shellgei160#%E7%AC%AC4%E5%88%B7%E3%81%BE%E3%81%A7
修正入れました。ありがとうございました。

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

2 participants