Is there a more efficient way to output a command than this:
whereis python > test.txt;date >> test.txt;who >> test.txt
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.
How about:
EDIT:
The
{...}notation instructsbashto launch these commands in the current shell, rather than use a subshell as would be the case if the(...)notation was used. It is slightly more efficient as it avoids creating a new process.If you want to temporarily change the environment (working directory, variables etc) for the comamnds, though, the
(...)notation is simpler to use, since you don’t have to manually revert all changes afterwards: