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
87284438
Unverified
Commit
87284438
authored
Jan 17, 2019
by
Rémy Huet
💻
Browse files
Entrées utilisateur
parent
eae3b905
Pipeline
#33586
passed with stage
in 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/tex/variables.tex
View file @
87284438
...
...
@@ -112,3 +112,25 @@ script.sh
\end{description}
\end{block}
\end{frame}
\begin{frame}
[fragile]
{
Entrées utilisateur
}
\begin{block}
{
Contexte
}
L'intérêt des variables, c'est aussi de pouvoir demander à l'utilisateur de saisir des données pour rendre le programme
{
\bf
interactif
}
\end{block}
\begin{block}
{
Utilisation
}
Pour lire une entrée utilisateur, on utilise la commande
\begin{center}
\texttt
{
read
\textcolor
{
red
}{
variable
}}
\end{center}
L'option
\texttt
{
-p
}
permet d'afficher un message dans le prompt.
{
\tiny\it
RTFM pour plus de super options !
}
\end{block}
Exemple (toujours dans
\texttt
{
script.sh
}
) :
\begin{beamercolorbox}
[rounded=true,shadow=true]
{
terminal
}
\begin{Verbatim}
read -p 'Quel est votre nom ? ' nom
echo ``Salut
$
nom''
\end
{
Verbatim
}
\end
{
beamercolorbox
}
\end
{
frame
}
Write
Preview
Markdown
is supported
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