Command-line arguments are a form of user input, but we can also capture interactive user input
while a script is running with the read command. In this example, we will use read to capture user
input and assign it to a variable:
1 | kali@kali:~$ cat ./input.sh |
We can alter the behavior of the read command with various command line options. Two of the
most commonly used options include -p, which allows us to specify a prompt, and -s, which makes
the user input silent. The latter is ideal for capturing user credentials:
1 | kali@kali:~$ cat ./input2.sh |