0

Is it possible to request a variable directly in the terminal? For example, I want to use command cat <some-file>, but I want the terminal to ask what file name to use. Just like in SQL plus I'm using bind variables for this.

Is there any solution for terminal?

fpmurphy
  • 4,556
  • 3
  • 23
  • 26

1 Answers1

0

You can use read varname to wait for user input, and store that input into $varname. Then you pass that variable into cat using cat $varname.

Look at some examples here.