I
I
Igor Petrov2020-03-03 07:31:55
linux
Igor Petrov, 2020-03-03 07:31:55

How to make a script with a question?

Hello!
Please tell me, the task is to make a simple script that, when launched, will ask: what name to assign to the folder, and in the script itself, so that the path to the folder creation site is already written. The main thing is that the output of the question should be through the console.
Thanks

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
rPman, 2020-03-03
@rPman

read $varname
https://ryanstutorials.net/bash-scripting-tutorial...

C
CityCat4, 2020-03-03
@CityCat4

If just a question to the console:

#!/bin/bash

echo -n "What is answer for The Ultimate Question of Life, the Universe, and Everything? : "
read $answer

echo "Of course, it is $answer!"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question