|
|
e5027323e1
|
fix(field_splitting): ensure no extraneous spaces appear
debug notes:
= 250 !! OK ===================================================================
export HOLA="bonjour "
echo $HOLA | cat -e
= out =
bonjour $
= err =
rc: 0
= refout =
bonjour$
++++++++++++++++++++++++++++++++++++++++++++++++++++
failed: quote removal before word splitting
++++++++++++++++++++++++++++++++++++++++++++++++++++
++++ test input:
export VAR="hello "
echo $VAR | cat -e
++++ Got output:
hello $
++++ But expected:
hello$
Problem is in post-processing:
parsed command
╰─ t_cmd
├─ t_cmd_type = FT_SIMPLE
├─ flags = 0
├─ line = 0
╰─ value
╰─ t_simple_cmd
├─ line = 0
├─ t_wordlist
│ ├─ t_worddesc
│ │ ├─ word = [echo]
│ │ ├─ marker = [ ]
│ │ ├─ flags = 0
│ │ ╰─ t_token_type = WORD_TOKEN
│ ╰─ t_worddesc
│ ├─ word = [$VAR]
│ ├─ marker = [ ]
│ ├─ flags = 1
│ ╰─ t_token_type = WORD_TOKEN
╰─ redirections = (empty redir list)
about to post-process
╰─ t_simple_cmd
├─ line = 0
├─ t_wordlist
│ ├─ t_worddesc
│ │ ├─ word = [echo]
│ │ ├─ marker = [ ]
│ │ ├─ flags = 0
│ │ ╰─ t_token_type = WORD_TOKEN
│ ╰─ t_worddesc
│ ├─ word = [$VAR]
│ ├─ marker = [ ]
│ ├─ flags = 1
│ ╰─ t_token_type = WORD_TOKEN
╰─ redirections = (empty redir list)
about to post-process
╰─ t_simple_cmd
├─ line = 0
├─ t_wordlist
│ ├─ t_worddesc
│ │ ├─ word = [echo]
│ │ ├─ marker = [ ]
│ │ ├─ flags = 0
│ │ ╰─ t_token_type = WORD_TOKEN
│ ╰─ t_worddesc
│ ├─ word = [hello ]
│ ├─ marker = [$$$$$$]
│ ├─ flags = 1
│ ╰─ t_token_type = WORD_TOKEN
╰─ redirections = (empty redir list)
about to post-process
╰─ t_simple_cmd
├─ line = 0
├─ t_wordlist
│ ├─ t_worddesc
│ │ ├─ word = [echo]
│ │ ├─ marker = [ ]
│ │ ├─ flags = 0
│ │ ╰─ t_token_type = WORD_TOKEN
│ ├─ t_worddesc
│ │ ├─ word = [hello]
│ │ ├─ marker = [$$$$$]
│ │ ├─ flags = 1
│ │ ╰─ t_token_type = WORD_TOKEN
│ ╰─ t_worddesc <---- WHAT IS THIS DOING HERE???
│ ├─ word = []
│ ├─ marker = []
│ ├─ flags = 1
│ ╰─ t_token_type = WORD_TOKEN
╰─ redirections = (empty redir list)
about to post-process
╰─ t_simple_cmd
├─ line = 0
├─ t_wordlist
│ ├─ t_worddesc
│ │ ├─ word = [echo]
│ │ ├─ marker = [ ]
│ │ ├─ flags = 0
│ │ ╰─ t_token_type = WORD_TOKEN
│ ├─ t_worddesc
│ │ ├─ word = [hello]
│ │ ├─ marker = [$$$$$]
│ │ ├─ flags = 1
│ │ ╰─ t_token_type = WORD_TOKEN
│ ╰─ t_worddesc
│ ├─ word = []
│ ├─ marker = []
│ ├─ flags = 1
│ ╰─ t_token_type = WORD_TOKEN
╰─ redirections = (empty redir list)
about to execute
╰─ t_simple_cmd
├─ line = 0
├─ t_wordlist
│ ├─ t_worddesc
│ │ ├─ word = [echo]
│ │ ├─ marker = [(null)]
│ │ ├─ flags = 0
│ │ ╰─ t_token_type = WORD_TOKEN
│ ├─ t_worddesc
│ │ ├─ word = [hello]
│ │ ├─ marker = [(null)]
│ │ ├─ flags = 1
│ │ ╰─ t_token_type = WORD_TOKEN
│ ╰─ t_worddesc
│ ├─ word = []
│ ├─ marker = [(null)]
│ ├─ flags = 1
│ ╰─ t_token_type = WORD_TOKEN
╰─ redirections = (empty redir list)
Problem seems to be in field splitting
|
2025-04-25 14:32:16 +02:00 |
|
|
|
2dd20b21bc
|
feat(redir): fieldsplit redir target, and handle ambiguous redirects
|
2025-04-24 12:44:33 +02:00 |
|
|
|
18014cda98
|
token_type: add field with no logic for populating it
|
2025-04-15 15:15:30 +02:00 |
|
|
|
32e3976774
|
field splitting: implement field splitting
|
2025-04-15 15:05:52 +02:00 |
|