How to perform input validation on bash arguments injected with \r?

89 Views Asked by At

I have a bash file, that takes one argument. This is used within ConfD CLI, for a command. However, if the user uses \r metacharacter, it throws my program off.

Example (on ConfD shell):

somecommand hellooooo\rtest

On displaying $@ within my bash file:

testooooo

Any suggestions on how to tackle this? Or is there a way to disable use of metacharacter for ConfD CLI itself?

0

There are 0 best solutions below