Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Picasoft
APIs
Init
Sh
Commits
2390b291
Unverified
Commit
2390b291
authored
Jan 17, 2019
by
Rémy Huet
💻
Browse files
Exemple
parent
f2e4f0ea
Pipeline
#33644
passed with stages
in 50 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/tex/conditions.tex
View file @
2390b291
...
...
@@ -185,6 +185,7 @@ fi
if [ -z
$
2
]
then
echo "Il n'y a pas de second argument"
fi
\end
{
Verbatim
}
\end
{
beamercolorbox
}
\end
{
frame
}
...
...
@@ -333,10 +334,10 @@ then
else
echo 'rendre le fichier executable ...'
chmod a+x dossier/test.sh
echo 'Écrire dans test.sh'
echo '#/bin/bash' > dossier/test.sh
echo 'ls /' >> dossier/test.sh
fi
echo 'Écrire dans test.sh'
echo '#/bin/bash' > dossier/test.sh
echo 'ls /' >> dossier/test.sh
fi
echo 'Exécuter dossier/test.sh'
./dossier/test.sh
...
...
@@ -373,8 +374,9 @@ if [ -w dossier/test.sh ]
else
echo 'rendre le fichier executable ...'
chmod a
+
x dossier
/
test.sh
[
\ldots
]
fi
[
\ldots
]
fi
\end
{
Verbatim
}
\end
{
beamercolorbox
}
\Pause
{}
\begin
{
block
}{}
...
...
@@ -404,4 +406,42 @@ if [ -w dossier/test.sh ]
\caption
{
Les opérateurs logiques
}
\label
{
tab:operateurs
_
logiques
}
\end
{
table
}
\begin
{
exampleblock
}{}
Pour utiliser ces opérateurs, on écrira
[
!
~condition~
]
pour non ou
[
~condition
1
~
]
<opérateur>
[
~condition
2
~
]
pour les autres.
\end
{
exampleblock
}
\end
{
frame
}
\begin
{
frame
}
[
fragile
]
{
Exemple
}
Dans
\texttt
{
script.sh
}
:
\begin
{
beamercolorbox
}
[
rounded
=
true, shadow
=
true
]
{
terminal
}
\begin
{
Verbatim
}
#
!/
bin
/
bash
age
1
=
17
age
2
=
19
if
[
$
age1 -ge 18 ]
&&
[
$
age
2
-
ge
18
]
then
echo Les deux sont majeurs
fi
if
[
$
age1 -lt 18 ] || [
$
age
2
-
lt
18
]
then
echo Un des deux ne l
\'
est pas
fi
if
[
!
$
age1 -lt 17 ]
then
echo 'Age1 >= 17'
fi
\end{Verbatim}
\end{beamercolorbox}
On exécute :
\begin{beamercolorbox}
[rounded=true, shadow=true]
{
terminal
}
\begin{Verbatim}
remy@hp-remy:~/scripts
$
.
/
script.sh
\Pause
Un des deux ne l'est pas
Age
1
>
=
17
\end
{
Verbatim
}
\end
{
beamercolorbox
}
\end
{
frame
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment