Skip to content

Commit

Permalink
norme
Browse files Browse the repository at this point in the history
  • Loading branch information
Virgile DESVAUX committed Apr 11, 2018
1 parent 0c03ed6 commit 40aeb89
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 7 deletions.
4 changes: 2 additions & 2 deletions inc/header.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
/* By: jamerlin <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/11/11 05:15:24 by videsvau #+# #+# */
/* Updated: 2018/04/11 11:38:39 by videsvau ### ########.fr */
/* Updated: 2018/04/11 17:04:30 by videsvau ### ########.fr */
/* */
/* ************************************************************************** */

#ifndef HEADER_H
# define HEADER_H
# define TERM "xterm-256color"
# define DEBUG 1
# define DEBUG 0
# define TTY_MAX 10000

# define DQUOTE 1
Expand Down
6 changes: 3 additions & 3 deletions src/exec/redir_tools.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: jamerlin <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/03/25 17:55:29 by jamerlin #+# #+# */
/* Updated: 2018/04/11 10:34:10 by drecours ### ########.fr */
/* Updated: 2018/04/11 17:03:50 by videsvau ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -72,12 +72,12 @@ t_pipe *new_tabtube(int len)

void dup_fd(t_listc *cmd, t_pipe *tabtube, int i)
{
/*if (fcntl(tabtube[i].cote[0], F_GETFD) == -1)
if (fcntl(tabtube[i].cote[0], F_GETFD) == -1)
{
ft_putstr_fd("21sh: ", 2);
ft_putchar_fd(tabtube[i].cote[0] + '0', 2);
errexit(": Bad file descriptor");
}**/
}
if (cmd->redirs->redir[1] != 0 && cmd->redirs->redir[1] != 4
&& cmd->redirs->redir[0] == 1)
dup2(tabtube[i].cote[0], STDOUT_FILENO);
Expand Down
109 changes: 109 additions & 0 deletions src/man/.history
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,112 @@ cat src/man/history.txt
cat src/man/history.txt | wc -l
x=cat src/man/history.txt | wc -l
x=`cat src/man/history.txt | wc -l`
ls -
ls -l
cat << EOF
ls -z 2>&-
ls -z 2>&1
ls -z 2>&1 | wc -l
ls -z 2>&1 | wc
cat .testFile
setenv SAVE=$PWD
rien && echo "perdu"
ls || echo "perdu"
cat < Makefile | wc >> /tmp/file
cat /tmp/file ; rm /tmp/file
unsetenv PATH
ls
setenv PATH=/bin
/bin/ls || echo "perdu"
setenv PATH=/Users/videsvau/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki
base64 /dev/urandom | head -c 1000 | grep 42 | wc -l | sed -e 's/1/Yes/g' -e 's/0/No/g'
base64 /dev/urandom | head -c 1000 | grep 42 | wc -l | sed -e 's/1/Yes/g' -e 's/0/No/g'
base64 /dev/urandom | head -c 1000 | grep 42 | wc -l | sed -e 's/1/Yes/g' -e 's/0/No/g'
echo "Testing redirections," > /tmp/test.txt ; echo "with multiple lines" >> /tmp/test.txt
cat /tmp/test.txt
rm /tmp/test.txt
cd /tmp;mkdir test ; cd test ; ls -a ; ls | cat | wc -c > fifi ; cat fifi ; cd .. ;rm -rf test
cd /tmp; sort << EOF | cat -e > sorted_poem ; sed -e 's/Roses/Turnips/' < sorted_poem > better_poem; cd -; echo "I prefer turnips anyway" >> /tmp/better_poem; cat /tmp/better_poem ; rm /tmp/better_poem
cd $SAVE
ls 6>file 1>&6
cat file
ls 1>&2 -l
ls 1>&2 -l | wc
ls 6>file 1>&5
ls 6>file 1>&5
ls 6>file 1>&6
cat file
cat < file
cat << EOF
cat .testFile
setenv SAVE=$PWD
rien && echo "perdu"
ls || echo "perdu"
cat < Makefile | wc >> /tmp/file
cat /tmp/file ; rm /tmp/file
unsetenv PATH
ls
setenv PATH=/bin
/bin/ls || echo "perdu"
setenv PATH=/Users/videsvau/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki
base64 /dev/urandom | head -c 1000 | grep 42 | wc -l | sed -e 's/1/Yes/g' -e 's/0/No/g'
base64 /dev/urandom | head -c 1000 | grep 42 | wc -l | sed -e 's/1/Yes/g' -e 's/0/No/g'
base64 /dev/urandom | head -c 1000 | grep 42 | wc -l | sed -e 's/1/Yes/g' -e 's/0/No/g'
echo "Testing redirections," > /tmp/test.txt ; echo "with multiple lines" >> /tmp/test.txt
cat /tmp/test.txt
rm /tmp/test.txt
cd /tmp;mkdir test ; cd test ; ls -a ; ls | cat | wc -c > fifi ; cat fifi ; cd .. ;rm -rf test
cd /tmp; sort << EOF | cat -e > sorted_poem ; sed -e 's/Roses/Turnips/' < sorted_poem > better_poem; cd -; echo "I prefer turnips anyway" >> /tmp/better_poem; cat /tmp/better_poem ; rm /tmp/better_poem
cd $SAVE
setenv SAVE=$PWD
rien && echo "perdu"
ls || echo "perdu"
cat < Makefile | wc >> /tmp/file
cat /tmp/file ; rm /tmp/file
unsetenv PATH
ls
setenv PATH=/bin
/bin/ls || echo "perdu"
setenv PATH=/Users/videsvau/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki
base64 /dev/urandom | head -c 1000 | grep 42 | wc -l | sed -e 's/1/Yes/g' -e 's/0/No/g'
base64 /dev/urandom | head -c 1000 | grep 42 | wc -l | sed -e 's/1/Yes/g' -e 's/0/No/g'
base64 /dev/urandom | head -c 1000 | grep 42 | wc -l | sed -e 's/1/Yes/g' -e 's/0/No/g'
echo "Testing redirections," > /tmp/test.txt ; echo "with multiple lines" >> /tmp/test.txt
cat /tmp/test.txt
rm /tmp/test.txt
cd /tmp;mkdir test ; cd test ; ls -a ; ls | cat | wc -c > fifi ; cat fifi ; cd .. ;rm -rf test
cd /tmp; sort << EOF | cat -e > sorted_poem ; sed -e 's/Roses/Turnips/' < sorted_poem > better_poem; cd -; echo "I prefer turnips anyway" >> /tmp/better_poem; cat /tmp/better_poem ; rm /tmp/better_poem
cat .testFile
setenv SAVE=$PWD
rien && echo "perdu"
ls || echo "perdu"
cat < Makefile | wc >> /tmp/file
cat /tmp/file ; rm /tmp/file
unsetenv PATH
ls
setenv PATH=/bin
/bin/ls || echo "perdu"
setenv PATH=/Users/videsvau/.brew/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/munki
base64 /dev/urandom | head -c 1000 | grep 42 | wc -l | sed -e 's/1/Yes/g' -e 's/0/No/g'
base64 /dev/urandom | head -c 1000 | grep 42 | wc -l | sed -e 's/1/Yes/g' -e 's/0/No/g'
base64 /dev/urandom | head -c 1000 | grep 42 | wc -l | sed -e 's/1/Yes/g' -e 's/0/No/g'
echo "Testing redirections," > /tmp/test.txt ; echo "with multiple lines" >> /tmp/test.txt
cat /tmp/test.txt
rm /tmp/test.txt
cd /tmp;mkdir test ; cd test ; ls -a ; ls | cat | wc -c > fifi ; cat fifi ; cd .. ;rm -rf test
cd /tmp; sort << EOF | cat -e > sorted_poem ; sed -e 's/Roses/Turnips/' < sorted_poem > better_poem; cd -; echo "I prefer turnips anyway" >> /tmp/better_poem; cat /tmp/better_poem ; rm /tmp/better_poem
ls
env
unsetenv PATH
env
l
ls
ls
ls
local
ls
echo e 1>&-
qef
echo e 4>&-
echo e 4>&45
echo e 4>&4
4 changes: 2 additions & 2 deletions src/parsing/tokenize_splitted.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/* By: videsvau <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/02/27 16:33:23 by videsvau #+# #+# */
/* Updated: 2018/04/10 14:38:27 by drecours ### ########.fr */
/* Updated: 2018/04/11 17:06:07 by videsvau ### ########.fr */
/* */
/* ************************************************************************** */

Expand Down Expand Up @@ -65,7 +65,7 @@ void redir_push_back(t_redir **redir, t_inpl **inpl, int type)
last = return_last_redir(redir);
last->next = new_redir(redir_type, file, here);
}
redir_debug(file, redir_type);
DEBUG ? redir_debug(file, redir_type) : 0;
}

void add_listc_token(t_inpl **inpl, t_listc **tok)
Expand Down

0 comments on commit 40aeb89

Please sign in to comment.