diff --git a/README.md b/README.md new file mode 100644 index 0000000..45a0cef --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +# fish : Fabulously Irrespectuous SHell + +fish is a student project, aiming to be a basic interactive shell for linux. + + +## Warnings + +fish is really an IRRESPECTUOUS shell. Now that you're warned... + + +## Features + +fish reads from standard input and send you the result of every command on standard output ( unless you redirect I/O ). Aside of that, fish also implements various features : + +* **Internal commands** : change of directory, exiting, help. +* **External commands** : fish will execute any command you ask, provided he can find those in his PATH variable. +* **Insults** : fish will yell at you whenever you make a mistake to make sure you never fail again. +* **Configuration file** : .fishrc file for easy configuration ( path, prompt.. ). +* **Globbing** : fish implements a globbing feature, handling characters such as \*, ? and ( soon ) ~. +* **Operators** : fish comes with some operators support : **&&** and **||**. +* **I/O redirections** : coming soon ( TM ) + + +everything without a single memory leak ! ( if you find one tell us ) + + +## License + +fish is licensed under the GPLv3 license. + + +## About us + +We're 3 students in CS, and this was one of our project. + +* Klmp200/Sli : Works for google in another dimension. +* Aethor/Bro : Not even a saint in the church of Emacs. +* Ame : The silent game master. diff --git a/fish_shell/fish_commands.c b/fish_shell/fish_commands.c index 1249b8f..99a7c1a 100644 --- a/fish_shell/fish_commands.c +++ b/fish_shell/fish_commands.c @@ -6,6 +6,7 @@ #include #include "fish_core.h" #include "fish_types.h" +#include "fish_settings.h" /* Necessary global variables */ char * builtinCommandsStr[] = { @@ -32,8 +33,16 @@ builtinCommand **getBuiltinCommands(){ int fishCd(WordArray *args) { if (args->size < 2){ - fprintf(stderr, "fish: Où sont les arguments de ta commande \"cd\" connard ?!\n"); - return EXIT_FAILURE; + //fprintf(stderr, "fish: Où sont les arguments de ta commande \"cd\" connard ?!\n"); + Settings* settings = getSettings(); + + if(chdir(settings->passwd->pw_dir) != 0){ + perror("fish"); + return EXIT_FAILURE; + } + freeSettings(settings); + //return EXIT_SUCCESS; + } else { if (chdir(args->words[1]) != 0){ perror("fish");