Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Benoit
minishell
Commits
c818ef25
Commit
c818ef25
authored
Feb 02, 2021
by
abenoit
Browse files
redir error output
parent
dd259218
Changes
2
Hide whitespace changes
Inline
Side-by-side
notes.txt
View file @
c818ef25
...
...
@@ -26,20 +26,19 @@ echo > $unknown_var ; ls ; ls (redir ambigue mais il fait quand meme ls)
=======================Resolu
create file when redirecting output without doing anything ("> a")
====================
====================
Strerror added
error when redir_in file does not exist ("< unknown_file")
====================Strerror added
error when redir_out file does not have write permission
compare with bash: "cat | exit"
"cat |"
then "ls"
compare with bash: "cat | exit"======>ne devrait pas exit
check_syntax:
echo "'"
echo '\'
echo '"'
"cat |"======>multiline error
...
...
src/execution/launch_command.c
View file @
c818ef25
#include "execution.h"
#include "builtins.h"
#include <string.h>
static
int
launch_exit
(
char
**
args
,
t_xe
*
xe
)
{
...
...
@@ -219,6 +220,12 @@ void apply_redir(char *cur_arg, enum e_redir_op redir)
{
dup2
(
redir_fd
,
src_fd
);
// error
}
else
{
ft_putstr_fd
(
cur_arg
,
STDERR_FILENO
);
ft_putstr_fd
(
": "
,
STDERR_FILENO
);
ft_putstr_fd
(
strerror
(
errno
),
STDERR_FILENO
);
}
}
void
apply_redirs
(
char
**
redir_paths
,
enum
e_redir_op
*
redir_types
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment