Brief-Wishbone9091
Member
Before you ask me to RTFM, Quoting from the manpages:
I want to know a real life use case of it. And please upvote the correct answer so that I can know it.
This is an example scenario where bash -c has been used in my tutorial that I'm following. I want to know its deep meaning.
But it's not very clear. I've read almost all stackoverflow and stackexchange questions about it and they've just complicated it for me.-c string If the -c option is present, then commands are read from string. If there are arguments after the string, they are assigned to the positional parameters, starting with $0.
I want to know a real life use case of it. And please upvote the correct answer so that I can know it.
Less:
bash -c 'echo $SHELL $HOME $USER'
env -i bash -c 'echo $SHELL $HOME $USER'
This is an example scenario where bash -c has been used in my tutorial that I'm following. I want to know its deep meaning.