please explain to me, it is too complex

R

robertchen117

Why the following is excuting the setup_env.sh, I am confused, grep?
grep is finding something?

grep (do { chop; s/^([^=]+)=(.*)$/$ENV{$1}=$2/e},`. /etc/software/
setup_env.sh; env`);
 
J

J¨¹rgen Exner

Why the following is excuting the setup_env.sh, I am confused, grep?
grep is finding something?

grep (do { chop; s/^([^=]+)=(.*)$/$ENV{$1}=$2/e},`. /etc/software/
setup_env.sh; env`);

Newline and white space is usually not a scarce resource. Use it liberally
to improve readability:

grep (do { chop; s/^([^=]+)=(.*)$/$ENV{$1}=$2/e
},
`. /etc/software/setup_env.sh; env`
);

So, in other words the second argument of grep is the qx command, here
written as backticks. Of course this command is executed, how else would
grep() be able to filter the list for those items indicated by the first
argument. What did you expect to happen?

jue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top