unow0517 / 42_minishell

1 stars 1 forks source link

Expander #24

Open tsimitop opened 6 months ago

tsimitop commented 6 months ago

awk '/main/ { print }' minishell.c works fine

$ awk ' { print $1 }' minishell.c doesn't work --error message prints: minishell: syntax error: can't handle unclosed quotes --history shows: awk ' { print

I also tested with: echo $USER $hi there is no error message -> only prints: echo tsimitop (which is correct assuming you are still using user_input and not builtin args) history shows: echo tsimitop (which should be echo $USER $hi)

Conclusion:

  1. values after $need to be printed in history as provided by user
  2. values after $ that are numbers definitely need to be able to be handled example export 1=1 bash: export: `1=1': not a valid identifier it seems you can't assign number variables
  3. ft_expand is not handling missing user input. I added "if (!shell_info->user_input) return ;" at the top, seems fine;
tsimitop commented 6 months ago

echo hello \^USER prints echo hello $USER

unow0517 commented 5 months ago

in my latest version it works, let's check together