This line is inside my /etc/rc.sysinit file on linux:
[ -r /proc/mdstat -a -r /dev/md/md-device-map ] && /sbin/mdadm -IRs
I’m not so much interested in what it actually accomplishes as opposed to how the syntax works.
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.
It tests if the files
/proc/mdstatand/dev/md/md-device-mapexists and are readable (-r), and if yes executes/sbin/mdadm -IRs.The square brackets are an alternative name of the program
test(or a Bash replacement thereof), which can test for lots of stuff, such as existence of files. The-ais a logical “and”.For more details, see “CONDITIONAL EXPRESSIONS” in
man bash.