Add all files
This commit is contained in:
127
C_Piscine_Shell_00/Makefile
Normal file
127
C_Piscine_Shell_00/Makefile
Normal file
@@ -0,0 +1,127 @@
|
||||
|
||||
#
|
||||
# Copyright (c) 2021 Guy Baconniere.
|
||||
#
|
||||
## How to use this Makefile
|
||||
#
|
||||
# cd git
|
||||
# mkdir ex00
|
||||
# cd ex00
|
||||
# make -f ../../Makefile ex00
|
||||
#
|
||||
|
||||
hash = \#
|
||||
|
||||
clone:
|
||||
@git clone git@vogsphere.42lausanne.ch:vogsphere/intra-uuid-6ab96e6e-8d3c-4e8c-98b0-b13b474817ad-3700999 git
|
||||
|
||||
tarball:
|
||||
@install -d -m 0750 resources
|
||||
@tar -C resources -xvf resources.tar.gz
|
||||
|
||||
ex00:
|
||||
@rm -f z
|
||||
@echo Z > z
|
||||
@cat z
|
||||
|
||||
ex01:
|
||||
@rm -f testShell00.tar
|
||||
@perl -e 'print "42"x20' > testShell00
|
||||
@touch -t 2106012342.00 testShell00
|
||||
@chmod 0455 testShell00
|
||||
@ls -l
|
||||
@tar -cf testShell00.tar testShell00
|
||||
@rm -f testShell00
|
||||
|
||||
ex02:
|
||||
@rm -fr test? exo2.tar
|
||||
@mkdir test0
|
||||
@mkdir test2
|
||||
@printf "4242" > test1
|
||||
@printf "4" > test3
|
||||
@printf "42" > test4
|
||||
@touch -t 2106012047.00 test0
|
||||
@touch -t 2106012146.00 test1
|
||||
@touch -t 2106012245.00 test2
|
||||
@touch -t 2106012344.00 test3
|
||||
@touch -t 2106012343.00 test4
|
||||
@ln test3 test5
|
||||
@ln -s test0 test6
|
||||
@touch -h -t 2106012220.00 test6
|
||||
@chmod 0715 test0
|
||||
@chmod 0714 test1
|
||||
@chmod 0504 test2
|
||||
@chmod 0404 test3
|
||||
@chmod 0641 test4
|
||||
@chmod 0404 test5
|
||||
@chmod -h 0755 test6
|
||||
@ls -l
|
||||
@tar -cf exo2.tar *
|
||||
@rm -fr test?
|
||||
|
||||
ex03:
|
||||
@rm -f klist.txt
|
||||
@klist -t || kinit -f -l 10h gbaconni@42LAUSANNE.CH
|
||||
@klist > klist.txt
|
||||
@cat klist.txt
|
||||
|
||||
ex04:
|
||||
@rm -fr midLS test?
|
||||
@mkdir test0
|
||||
@touch -r /usr/bin/topsyscall test1
|
||||
@touch -r /bin/sh test2
|
||||
@touch test3
|
||||
@printf "#!/bin/sh\n" > midLS
|
||||
@printf "ls -mptU\n" >> midLS
|
||||
@chmod +x midLS
|
||||
@./midLS
|
||||
@rm -fr midLS test?
|
||||
@printf "ls -mptU\n" > midLS
|
||||
|
||||
ex05:
|
||||
@rm -fr git_commit.sh
|
||||
@printf "#!/bin/sh\n" > git_commit.sh
|
||||
@printf "git log --pretty='%%H' --max-count=5\n" >> git_commit.sh
|
||||
@chmod +x git_commit.sh
|
||||
@bash git_commit.sh | cat -e
|
||||
|
||||
ex06:
|
||||
@rm -fr git_ignore.sh .DS_Store mywork.c~
|
||||
@touch .DS_Store mywork.c~
|
||||
@printf "#!/bin/sh\n" > git_ignore.sh
|
||||
@printf "git ls-files --exclude-standard --ignored --others\n" >> git_ignore.sh
|
||||
@chmod +x git_ignore.sh
|
||||
@cd .. && bash ex06/git_ignore.sh | cat -e
|
||||
@rm -fr .DS_Store mywork.c~
|
||||
|
||||
ex07:
|
||||
@cp ../../resources/* .
|
||||
@cp a b
|
||||
@echo "Enter b"
|
||||
@patch < sw.diff
|
||||
@rm -f a sw.diff
|
||||
|
||||
ex08:
|
||||
@rm -f clean test? ?test
|
||||
@touch -r /bin/sh "test$(hash)"
|
||||
@touch "$(hash)test"
|
||||
@touch "test~"
|
||||
@touch "test0"
|
||||
@printf "#!/bin/sh\n" > clean
|
||||
@printf "find . -type f \( -name '*~' -o -name '#*#' \) -print -delete\n" >> clean
|
||||
@chmod +x clean
|
||||
@./clean
|
||||
@ls -l
|
||||
@rm -f clean test? ?test
|
||||
@printf "find . -type f \( -name '*~' -o -name '#*#' \) -print -delete\n" >> clean
|
||||
|
||||
ex09:
|
||||
@rm -f ft_magic test?
|
||||
@touch -r /bin/sh "test0"
|
||||
@perl -e 'print "\0"x41 . "42"' > "test1"
|
||||
@printf "41\tstring\t42\t42 file\n" > ft_magic
|
||||
@file -m ft_magic *
|
||||
@rm -f test?
|
||||
|
||||
all: clone
|
||||
|
||||
BIN
C_Piscine_Shell_00/fr.subject.pdf
Normal file
BIN
C_Piscine_Shell_00/fr.subject.pdf
Normal file
Binary file not shown.
1
C_Piscine_Shell_00/git
Submodule
1
C_Piscine_Shell_00/git
Submodule
Submodule C_Piscine_Shell_00/git added at c34d7f6d55
1
C_Piscine_Shell_00/git_old
Submodule
1
C_Piscine_Shell_00/git_old
Submodule
Submodule C_Piscine_Shell_00/git_old added at 50ee51f097
21
C_Piscine_Shell_00/playlist.html
Normal file
21
C_Piscine_Shell_00/playlist.html
Normal file
File diff suppressed because one or more lines are too long
BIN
C_Piscine_Shell_00/resources.tar.gz
Normal file
BIN
C_Piscine_Shell_00/resources.tar.gz
Normal file
Binary file not shown.
9
C_Piscine_Shell_00/resources/a
Normal file
9
C_Piscine_Shell_00/resources/a
Normal file
@@ -0,0 +1,9 @@
|
||||
STARWARS
|
||||
Episode IV, A NEW HOPE It is a period of civil war.
|
||||
|
||||
Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.
|
||||
During the battle, Rebel spies managed to steal secret plans to the Empire's ultimate weapon, the DEATH STAR,
|
||||
an armored space station with enough power to destroy an entire planet.
|
||||
|
||||
Pursued by the Empire's sinister agents, Princess Leia races home aboard her starship, custodian of the stolen plans that can save her people and restore freedom to the galaxy...
|
||||
|
||||
18
C_Piscine_Shell_00/resources/sw.diff
Normal file
18
C_Piscine_Shell_00/resources/sw.diff
Normal file
@@ -0,0 +1,18 @@
|
||||
1,2c1,8
|
||||
< STARWARS
|
||||
< Episode IV, A NEW HOPE It is a period of civil war.
|
||||
---
|
||||
> Episode V, A NEW H0PE It is a period of civil war
|
||||
> Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.
|
||||
> During the battle, Rebel spies managed to steal secret plans to the Empire's ultimate weapon, the STAR DEATH, an armored space station with enough power to destroy an entire planet.
|
||||
>
|
||||
>
|
||||
> Pursued by the Empire's sinister agents,
|
||||
> Princess Mehdi races home aboard her starship, custodian of the stolen plans that can save her people and restore the dictatorship to the galaxie..
|
||||
>
|
||||
4,6d9
|
||||
< Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.
|
||||
< During the battle, Rebel spies managed to steal secret plans to the Empire's ultimate weapon, the DEATH STAR,
|
||||
< an armored space station with enough power to destroy an entire planet.
|
||||
8d10
|
||||
< Pursued by the Empire's sinister agents, Princess Leia races home aboard her starship, custodian of the stolen plans that can save her people and restore freedom to the galaxy...
|
||||
BIN
C_Piscine_Shell_00/tmp/exo2.tar
Normal file
BIN
C_Piscine_Shell_00/tmp/exo2.tar
Normal file
Binary file not shown.
1
C_Piscine_Shell_00/tmp/t
Symbolic link
1
C_Piscine_Shell_00/tmp/t
Symbolic link
@@ -0,0 +1 @@
|
||||
test3
|
||||
1
C_Piscine_Shell_00/tmp/test1
Executable file
1
C_Piscine_Shell_00/tmp/test1
Executable file
@@ -0,0 +1 @@
|
||||
4242
|
||||
1
C_Piscine_Shell_00/tmp/test3
Normal file
1
C_Piscine_Shell_00/tmp/test3
Normal file
@@ -0,0 +1 @@
|
||||
4
|
||||
1
C_Piscine_Shell_00/tmp/test4
Normal file
1
C_Piscine_Shell_00/tmp/test4
Normal file
@@ -0,0 +1 @@
|
||||
42
|
||||
1
C_Piscine_Shell_00/tmp/test5
Normal file
1
C_Piscine_Shell_00/tmp/test5
Normal file
@@ -0,0 +1 @@
|
||||
4
|
||||
1
C_Piscine_Shell_00/tmp/test6
Symbolic link
1
C_Piscine_Shell_00/tmp/test6
Symbolic link
@@ -0,0 +1 @@
|
||||
test0
|
||||
Reference in New Issue
Block a user