42/42s Cursus
[Rank 3] Minishell - 쌍따옴표와 홑따옴표
치춘
2022. 2. 3. 17:55
bash & echo
$> echo -n "'"'"'hello'"'"'"
'"hello"'
$>
"'"'"'hello'"'"'"
→ "'"
, '"'
, hello
, '"'
, "'"
이렇게 5덩이로 짤리기 때문에 쟤네만 남음
$> echo """"'hello'""""
hello
$> echo """'hello'"""
'hello'
$> echo '''"hello"'''
"hello"
$> echo ''''"hello"''''
hello
$>
""""'hello'""""
""
,""
,'hello'
,""
,""
5덩어리로 나뉘어짐"""'hello'"""
""
,"'hello'"
,""
3덩어리로 나뉘어짐'''"hello"'''
''
,'"hello"'
,''
3덩어리로 나뉘어짐''''"hello"''''
''
,''
,"hello"
,''
,''
5덩어리로 나뉘어짐
bash 추가 룰
$> l"s" "-al"
# ls -al로 처리 (명령어가 ls, 플래그가 al)
$> "ls -al"
# 명령어가 ls -al로 들어오게 되어 오류