RPDJF / 42-minishell

Un mini-shell stylé de l'école 42 pour les codeurs intrépides 💻
3 stars 0 forks source link

Interpretation of environment variables. #70

Closed IlYAN-FISHERMAN closed 6 months ago

IlYAN-FISHERMAN commented 6 months ago

the interpretation of environment variables is not correct,

when the expend is done it should interpret the spaces inside as being a separator.

┌─[ilkayyanar] [SHLVL 5]
└─[~/travail/repo_github/minishell-42] [0]-❥ a="ls"

┌─[ilkayyanar] [SHLVL 5]
└─[~/travail/repo_github/minishell-42] [0]-❥ $a
Makefile        docs            minishell       src
README.md       libs            minishell.dSYM  wtf

┌─[ilkayyanar] [SHLVL 5]
└─[~/travail/repo_github/minishell-42] [0]-❥ a="ls -l"

┌─[ilkayyanar] [SHLVL 5]
└─[~/travail/repo_github/minishell-42] [0]-❥ $a
ls -l: command not found

┌─[ilkayyanar] [SHLVL 5]
└─[~/travail/repo_github/minishell-42] [127]-❥ a='""ls -l""'

┌─[ilkayyanar] [SHLVL 5]
└─[~/travail/repo_github/minishell-42] [0]-❥ $a
""ls -l"": command not found

┌─[ilkayyanar] [SHLVL 5]
└─[~/travail/repo_github/minishell-42] [127]-❥ bash
bash-5.2$ a="ls"
bash-5.2$ $a
Makefile        docs            minishell       src
README.md       libs            minishell.dSYM  wtf
bash-5.2$ a="ls -l"
bash-5.2$ $a
total 264
-rw-r--r--   1 ilkayyanar  staff   15507 Apr 24 16:28 Makefile
-rw-r--r--   1 ilkayyanar  staff    1925 Apr 23 23:44 README.md
drwxr-xr-x   5 ilkayyanar  staff     160 Apr 23 23:44 docs
drwxr-xr-x   3 ilkayyanar  staff      96 Mar 26 20:33 libs
-rwxr-xr-x   1 ilkayyanar  staff  110392 Apr 25 13:50 minishell
drwxr-xr-x   3 ilkayyanar  staff      96 Apr 24 16:38 minishell.dSYM
drwxr-xr-x  14 ilkayyanar  staff     448 Apr 25 13:48 src
-rw-r--r--   1 ilkayyanar  staff      10 Apr 25 14:12 wtf
bash-5.2$ a='""ls -l""'
bash-5.2$ $a
bash: ""ls: command not found