0
0
This commit is contained in:
Guy Baconniere
2021-08-20 10:02:38 +02:00
parent 5aa02c94b5
commit d30270c485
354 changed files with 0 additions and 0 deletions

127
Shell_00/Makefile Normal file
View 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
Shell_00/fr.subject.pdf Normal file

Binary file not shown.

1
Shell_00/git/ex00/z Normal file
View File

@@ -0,0 +1 @@
Z

Binary file not shown.

9
Shell_00/git/ex02/a Normal file
View File

@@ -0,0 +1,9 @@
total 56
-rw-r--r-- 1 gbaconni 2021_lausanne 0 Aug 6 12:37 a
drwx--xr-x 2 gbaconni 2021_lausanne 68 Jun 1 20:47 test0
-rwx--xr-- 1 gbaconni 2021_lausanne 4 Jun 1 21:46 test1
dr-x---r-- 2 gbaconni 2021_lausanne 68 Jun 1 22:45 test2
-r-----r-- 2 gbaconni 2021_lausanne 1 Jun 1 23:44 test3
-rw-r----x 1 gbaconni 2021_lausanne 2 Jun 1 23:43 test4
-r-----r-- 2 gbaconni 2021_lausanne 1 Jun 1 23:44 test5
lrwxr-xr-x 1 gbaconni 2021_lausanne 5 Jun 1 22:20 test6 -> test0

BIN
Shell_00/git/ex02/exo2.tar Normal file

Binary file not shown.

1
Shell_00/git/ex02/test1 Executable file
View File

@@ -0,0 +1 @@
4242

1
Shell_00/git/ex02/test3 Normal file
View File

@@ -0,0 +1 @@
4

1
Shell_00/git/ex02/test4 Normal file
View File

@@ -0,0 +1 @@
42

1
Shell_00/git/ex02/test5 Normal file
View File

@@ -0,0 +1 @@
4

1
Shell_00/git/ex02/test6 Symbolic link
View File

@@ -0,0 +1 @@
test0

View File

@@ -0,0 +1,6 @@
Credentials cache: API:09810757-2460-4F5E-BA1C-C96952B0B1C0
Principal: gbaconni@42LAUSANNE.CH
Issued Expires Principal
Aug 2 09:02:44 2021 Aug 2 19:02:44 2021 krbtgt/42LAUSANNE.CH@42LAUSANNE.CH
Aug 2 09:02:46 2021 Aug 2 19:02:44 2021 HTTP/student-storage.42lausanne.ch@42LAUSANNE.CH

1
Shell_00/git/ex04/midLS Normal file
View File

@@ -0,0 +1 @@
ls -mptU

View File

@@ -0,0 +1,2 @@
#!/bin/sh
git log --pretty='%H' --max-count=5

View File

@@ -0,0 +1,2 @@
#!/bin/sh
git ls-files --exclude-standard --ignored --others

11
Shell_00/git/ex07/b Normal file
View File

@@ -0,0 +1,11 @@
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..

1
Shell_00/git/ex08/clean Normal file
View File

@@ -0,0 +1 @@
find . -type f \( -name '*~' -o -name '#*#' \) -print -delete

View File

@@ -0,0 +1 @@
41 string 42 42 file

2
Shell_00/git_old/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
.DS_Store
mywork.c~

1
Shell_00/git_old/ex00/z Normal file
View File

@@ -0,0 +1 @@
Z

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,6 @@
Credentials cache: API:09810757-2460-4F5E-BA1C-C96952B0B1C0
Principal: gbaconni@42LAUSANNE.CH
Issued Expires Principal
Aug 2 09:02:44 2021 Aug 2 19:02:44 2021 krbtgt/42LAUSANNE.CH@42LAUSANNE.CH
Aug 2 09:02:46 2021 Aug 2 19:02:44 2021 HTTP/student-storage.42lausanne.ch@42LAUSANNE.CH

View File

@@ -0,0 +1 @@
ls -mptU

View File

@@ -0,0 +1,2 @@
#!/bin/sh
git log --pretty='%H' --max-count=5

View File

@@ -0,0 +1,2 @@
#!/bin/sh
git ls-files --exclude-standard --ignored --others

11
Shell_00/git_old/ex07/b Normal file
View File

@@ -0,0 +1,11 @@
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..

View File

@@ -0,0 +1 @@
find . -type f \( -name '*~' -o -name '#*#' \) -print -delete

View File

@@ -0,0 +1 @@
41 string 42 42 file

21
Shell_00/playlist.html Normal file

File diff suppressed because one or more lines are too long

BIN
Shell_00/resources.tar.gz Normal file

Binary file not shown.

9
Shell_00/resources/a Normal file
View 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...

View 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
Shell_00/tmp/exo2.tar Normal file

Binary file not shown.

1
Shell_00/tmp/t Symbolic link
View File

@@ -0,0 +1 @@
test3

1
Shell_00/tmp/test1 Executable file
View File

@@ -0,0 +1 @@
4242

1
Shell_00/tmp/test3 Normal file
View File

@@ -0,0 +1 @@
4

1
Shell_00/tmp/test4 Normal file
View File

@@ -0,0 +1 @@
42

1
Shell_00/tmp/test5 Normal file
View File

@@ -0,0 +1 @@
4

1
Shell_00/tmp/test6 Symbolic link
View File

@@ -0,0 +1 @@
test0