This command works very well.
bash < <(echo 'ls')
How this code work?
I cannot understand internal process of this script.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
<(echo 'stuff')is called process substitution. It uses a named pipe (or FIFO) to pipe the output from the command (although the exact mechanism is system dependant). You can use this construct anywhere* that a file name can be used, so with:we are taking the output from command and passing it to the standard-input stream of program.
*anywhere: some programs use a technique called memory mapping (see
man 2 mmap) which cannot be used with named pipes. A well written program will check the file type beforehand, unfortunately not all programs are well written….