Skip to content
GitLab
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
f20aa198
Unverified
Commit
f20aa198
authored
Jan 18, 2019
by
Rémy Huet
💻
Browse files
Retour sur les paramètres
parent
53b0ca29
Pipeline
#33701
passed with stages
in 52 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/tex/boucles.tex
View file @
f20aa198
...
...
@@ -161,7 +161,7 @@ done
\end{itemize}
\end{block}
\end{frame}
\begin{frame}
[fragile]
{
s
olution
}
\begin{frame}
[fragile]
{
S
olution
}
Proposition de solution:
\begin{beamercolorbox}
[rounded=true, shadow=true]
{
terminal
}
\begin{Verbatim}
...
...
@@ -189,3 +189,24 @@ done
\end
{
Verbatim
}
\end
{
beamercolorbox
}
\end
{
frame
}
\begin
{
frame
}
[
fragile
]
{
Retour sur les paramètres
}
\begin
{
block
}{
Contexte
}
Tout à l'heure, on a vu que les paramètres n'étaient accessibles que via
9
variables.
Mais il est bien possible d'avoir plus de
9
paramètres sur un script.
On utilisera alors la commande
\texttt
{
shift
}
pour
\enquote
{
décaler
}
les paramètres.
(
\verb
+
$
2 ->
$
1
,
$
3 ->
$
2
...
[
...
]
-
>
$
9+)
\end{block}
Exemple : écrire un script qui liste tous les paramètres avec leur place:
\Pause
\begin{beamercolorbox}
[rounded=true, shadow=true]
{
terminal
}
\begin{Verbatim}
#!/bin/bash
for i in `seq 1
$
#`
do
echo "Le paramètre
$
i vaut
$
1
"
shift
done
\end
{
Verbatim
}
\end
{
beamercolorbox
}
\end
{
frame
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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