Bash scripts. Passing arguments

53 views
Skip to first unread message

Algo Surfer

unread,
Sep 30, 2020, 4:29:47 PM9/30/20
to rextester
Which is the way , if there is any, to pass arguments to my script?
Thanks in advance.

Algo Surfer

unread,
Sep 30, 2020, 5:00:08 PM9/30/20
to rextester
I have found these instructions but cannot send my input

If your code waits for input from stdin (keyboard) you have to supply it all at once in the input text-area (which shows up after you click '+' sign at the bottom). The whole input should be supplied before running code - at runtime it will be piped to the stdin stream of the process.

ren

unread,
Oct 1, 2020, 9:18:56 AM10/1/20
to rextester
No way to supply command line arguments. An example to consume stdin is here https://rextester.com/TND65543

Algo Surfer

unread,
Oct 1, 2020, 9:19:05 AM10/1/20
to rextester
To clarify my previous question ( I don't know how to replace it )
  •   My question is not involved with sending interactive input in reply to a read or sort of command   during script execution.
  •   What I am referring to,  is sending command line options and arguments to the script at invocation time.

Please if there is a way to do it I will appreciate your advice. Tks

Algo Surfer

unread,
Oct 1, 2020, 9:20:27 AM10/1/20
to rextester
Many thanks ren!   I read your reply after I sent my last aclaration
Have a nice day and thanks again

alvinse...@gmail.com

unread,
Oct 1, 2020, 9:22:52 AM10/1/20
to rextester
It would be nice to have an ability to provide command line args via separate field. ;)

alvinse...@gmail.com

unread,
Oct 1, 2020, 9:25:51 AM10/1/20
to rextester
P.S. What about set built-in?

ren

unread,
Oct 1, 2020, 9:34:10 AM10/1/20
to rextester
It's not available for bash, but it is for some other languages like C++ ( + ] Compiler args  box at the bottom)
Reply all
Reply to author
Forward
0 new messages