42shpimanmls / 42sh Goto Github PK
View Code? Open in Web Editor NEWShell project at 42
Shell project at 42
✘ n0iz@arch-vm ~/Projects/42sh master ./42sh
[/home/n0iz/Projects/42sh]$ foo '
entrée
quote> bar'
entrée
<syntax_tree>
command: foo '\nbar'
</syntax_tree>
puis faire flèche haut
[/home/n0iz/Projects/42sh]$ foo '
bar'
Puis essayer de revenir au début de la ligne, puis essayer de dépasser la fin de la ligne. @pilespin je t'en parlais heir
Le build travis a randomly fail sur 2 tests de bang_n - à tester, retester, reretester
?? -> http://www.unix.com/man-page/POSIX/3posix/unsetenv/
csh:
unsetenv pattern
Removes all environment variables whose names match pattern. 'unsetenv *' thus removes all environment variables; this is a bad idea. It is not an error for nothing to be unsetenved.
(https://linux.die.net/man/1/csh)
test issue
Has something to do with the way the editor reads input
need test for:
cd
setenv
unsetenv
get_variables_for_execution()
...
Ce serait possible de faire un prompt modifiable dans le code ? Je peux le faire si c'est possible et que personne est déter'
The syntax tree is leaked in every possible way
./42sh
entrée puis fleche haut
Program received signal SIGSEGV, Segmentation fault.
0x0000000000405784 in str_to_list (ed=0x60c338 <get_editor.ed>, str=0x0)
at srcs/read_input/event_callbacks/history.c:18
18 while (*str)
execute_pipeline.c:20: warning: sys_errlist' is deprecated; use
strerror' or `strerror_r' instead
4e ligne de la partie obligatoire du sujet, pour l'instant on les ignore
To continue #20 discussion.
I want to make tests works on 42's macOS.
I installed automake
:
brew install automake
Warning: automake-1.15 already installed
and it still doesn't works:
/Users/mazimi/projects/42sh/tests}-> make
BUILDING CUNIT:
tar -xf /Users/mazimi/projects/42sh/tests/CUnit-2.1-3.tar.bz2
cd /Users/mazimi/projects/42sh/tests/CUnit-2.1-3 && mv configure.in configure.ac
cd /Users/mazimi/projects/42sh/tests/CUnit-2.1-3 && aclocal
/bin/sh: aclocal: command not found
make: *** [/Users/mazimi/projects/42sh/tests/CUnit-2.1-3/install/lib/libcunit.a] Error 127
I will try to make it works on my GNU/Linux distro.
42sh
[n0iz@arch-vm ~/Projects/42sh]$ false && echo PASS || echo FAIL
PASS
sh
sh-4.4$ false && echo PASS || echo FAIL
FAIL
either leave the \n => change history_to_file & history_load + needs removing during substitution
or trim it
When moving cursor, and editing line, char are added at the end of the line.
42sh
[n0iz@arch-vm ~/Projects/42sh]$ false && echo bug
bug
sh
sh-4.4$ false && echo bug
?? -> http://www.unix.com/man-page/POSIX/3posix/setenv/
csh:
setenv [name [value]]
Without arguments, prints the names and values of all environment variables. Given name, sets the environment variable name to value or, without value, to the null string.
(https://linux.die.net/man/1/csh)
$ `qsdqsdqsd` && echo SUCCESS || echo FAILURE
sh:
FAILURE
42sh:
SUCCESS
et c'est lui qui établit /usr/bin:/bin comme PATH par défaut, d'où le comportement de bash
Qqun avait vu que dans les fonctions autorisée il y avait ça ????
EV_SET.2
FD_CLR.2
FD_COPY.2
FD_ISSET.2
FD_SET.2
FD_ZERO.2
_exit.2
accept.2
access.2
acct.2
adjtime.2
aio_cancel.2
aio_error.2
aio_read.2
aio_return.2
aio_suspend.2
aio_write.2
audit.2
auditctl.2
auditon.2
bind.2
brk.2
chdir.2
chflags.2
chmod.2
chown.2
chroot.2
clonefile.2
clonefileat.2
close.2
connect.2
connectx.2
creat.2
disconnectx.2
dup.2
dup2.2
exchangedata.2
execve.2
faccessat.2
fchdir.2
fchflags.2
fchmod.2
fchmodat.2
fchown.2
fchownat.2
fclonefileat.2
fcntl.2
fgetattrlist.2
fgetxattr.2
fhopen.2
flistxattr.2
flock.2
fork.2
fpathconf.2
fremovexattr.2
fsetattrlist.2
fsetxattr.2
fstat.2
fstat64.2
fstatat.2
fstatfs.2
fstatfs64.2
fsync.2
ftruncate.2
futimes.2
getattrlist.2
getattrlistat.2
getattrlistbulk.2
getaudit.2
getaudit_addr.2
getauid.2
getdirentries.2
getdirentriesattr.2
getdtablesize.2
getegid.2
getentropy.2
geteuid.2
getfh.2
getfsstat.2
getgid.2
getgroups.2
gethostuuid.2
getitimer.2
getlogin.2
getpeername.2
getpgid.2
getpgrp.2
getpid.2
getppid.2
getpriority.2
getrlimit.2
getrusage.2
getsid.2
getsockname.2
getsockopt.2
gettimeofday.2
getuid.2
getxattr.2
i386_get_ldt.2
i386_set_ldt.2
intro.2
ioctl.2
issetugid.2
kevent.2
kevent64.2
kevent_qos.2
kill.2
killpg.2
kqueue.2
lchown.2
link.2
linkat.2
listen.2
listxattr.2
lseek.2
lstat.2
lstat64.2
madvise.2
mincore.2
minherit.2
mkdir.2
mkdirat.2
mkfifo.2
mknod.2
mlock.2
mmap.2
mount.2
mprotect.2
msync.2
munlock.2
munmap.2
nanosleep.2
nfsclnt.2
nfssvc.2
open.2
openat.2
pathconf.2
pipe.2
poll.2
posix_madvise.2
posix_spawn.2
posix_spawnp.2
pread.2
profil.2
pselect.2
pthread_kill.2
pthread_setugid_np.2
pthread_sigmask.2
ptrace.2
pwrite.2
quotactl.2
read.2
readlink.2
readlinkat.2
readv.2
reboot.2
recv.2
recvfrom.2
recvmsg.2
removexattr.2
rename.2
renameat.2
renameatx_np.2
renamex_np.2
revoke.2
rmdir.2
sbrk.2
searchfs.2
select.2
sem_close.2
sem_open.2
sem_post.2
sem_trywait.2
sem_unlink.2
sem_wait.2
semctl.2
semget.2
semop.2
send.2
sendfile.2
sendmsg.2
sendto.2
setattrlist.2
setaudit.2
setaudit_addr.2
setauid.2
setegid.2
seteuid.2
setgid.2
setgroups.2
setitimer.2
setlogin.2
setpgid.2
setpgrp.2
setpriority.2
setregid.2
setreuid.2
setrlimit.2
setsid.2
setsockopt.2
settimeofday.2
setuid.2
setxattr.2
shm_open.2
shm_unlink.2
shmat.2
shmctl.2
shmdt.2
shmget.2
shutdown.2
sigaction.2
sigaltstack.2
sigblock.2
sigmask.2
sigpause.2
sigpending.2
sigprocmask.2
sigsetmask.2
sigstack.2
sigsuspend.2
sigvec.2
sigwait.2
socket.2
socketpair.2
stat.2
stat64.2
statfs.2
statfs64.2
symlink.2
symlinkat.2
sync.2
truncate.2
umask.2
undelete.2
unlink.2
unlinkat.2
unmount.2
utimes.2
vfork.2
wait.2
wait3.2
wait4.2
waitpid.2
write.2
writev.2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.