0
0

Add all files

This commit is contained in:
Baco
2021-08-15 23:24:04 +02:00
parent 89e2300062
commit e2b7ebd85f
68 changed files with 970 additions and 0 deletions

127
C_Piscine_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

Binary file not shown.

Submodule C_Piscine_Shell_00/git added at c34d7f6d55

Submodule C_Piscine_Shell_00/git_old added at 50ee51f097

File diff suppressed because one or more lines are too long

Binary file not shown.

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...

Binary file not shown.

1
C_Piscine_Shell_00/tmp/t Symbolic link
View File

@@ -0,0 +1 @@
test3

1
C_Piscine_Shell_00/tmp/test1 Executable file
View File

@@ -0,0 +1 @@
4242

View File

@@ -0,0 +1 @@
4

View File

@@ -0,0 +1 @@
42

View File

@@ -0,0 +1 @@
4

View File

@@ -0,0 +1 @@
test0