can someone explain to me what it means?
LOG=/etc/security/aixpert/log/aixpert.log
exec 1>>$LOG
exec 2>&1
I know that we are logging into a file… but what exactly it does? especially the 1, 2, >& and in general
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.
execmanipulates file descriptors. In particular, you redirect file descriptor 1 (which corresponds to C’sstdout) to the designated file on disk, and you redirect file descriptor 2 (stderr) to file descriptor 1.So everything ends up getting written into the log file rather than being printed on the console.