I am wondering how I can validate user input, to check if it is a valid bash command - in terms of syntax? I guess it is not possible to create regex for that. Are there any libraries to handle this?
Thanks
I am wondering how I can validate user input, to check if it is a valid bash command - in terms of syntax? I guess it is not possible to create regex for that. Are there any libraries to handle this?
Thanks
You can't. There is no practical way to validate a shell command without running it.