Giter VIP home page Giter VIP logo

minishell's Introduction

Minishell

minishell's People

Contributors

sansho88 avatar rgeral avatar

Stargazers

Alexis Lavaud avatar  avatar

Watchers

 avatar  avatar

minishell's Issues

Error messages

Set a proper error message when a command doesn't exist

Historic issue

test : ls | ls | ls | ls | ls | ls | ls | ls | ls | ls |ls | ls | ls | ls | ls |ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | v ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls |ls | ls | ls | ls | ls |ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | v ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls | ls

Segfault when pressing up arrow.

Arg is empty when redir detected

In [t_argmode *split_arg_redirect(char *cmdline, int *argc)] function, in parse_redirecs.c file.

When there's a redirection detected in the command line, t_argmode.arg = null (check "ft_fill_argmode_array" ? )

Quotes to debug

To fix:

  • Single quotes interpreted into double quotes
  • env_var interpreted when into single quotes

Use our own echo

When detected, our "echo" built-ins have to be used, and the -nnnnnnnnnnnnn option should works as a simple -n.

CTRL+C gives back a fake empty prompt

When CTRL+C is performed, the prompt is given back but the last entered line is still in the memory's prompt.
(todo: free the args? Force an empty line in?)
image

Env in main swapped on struct

I swapped the Env from "custom_env" to data.env in the main, now env is working : (old ones in "//"

` int main(int argc, char *argv[], char *env[])
{
char *commandline;
t_argmode *args;
t_args data;
int nb_args;
//char **custom_env;

commandline = ft_strdup("empty");
get_signals();
//custom_env = init_env(env);
data.env = init_env(env);
while (commandline && ft_strncmp(commandline, "exit", 5))
{
	free(commandline);
	sign_chars_manager(false);
	commandline = readline(CONCHITO);
	sign_chars_manager(true);
	if (!commandline)
		exit(0);
	add_history(commandline);
	//dprintf(2, "[%s]command line = %s\n", __func__, commandline);
	rl_redisplay();
	if (*commandline && is_cmdline_ok(&commandline, data.env))
	{
		nb_args = (int)get_nb_seps(commandline) + 1; //forcement au moins 1 arg
		args = create_targmode_array(commandline);
		//debug_t_argmode(args, nb_args);
		if (are_args_ok(args, nb_args))
			exec_home(args, nb_args, &data);
	}
}
exit(0);

}`

I let you swap it if you are ok with it on the main.

Better ENV

We need an env that doesn't reset at each command !
I need the parsing to give me a stable env that does't back to the "vanilla" env each time we put a command.

Wrong arg order for Heredoc

In the heredoc :
"cat << eof"
Check on debug printf.
I have no "cat" on the arguments that the parsing supposed to send to exec. <3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.