APPLICATION_LOG_DIR=/home/users/sosst51/test-chinboon/logs/testdata1
PREFIX=mylog
for i in `ls ${APPLICATION_LOG_DIR}/${PREFIX}*`
Is this a for loop whereby i am passing the ls of the directory into i.
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.
In bash,
for s in stringwill take a string and split it on whitespace, and iterate over each of the words. So:would print:
By passing it the output of ls, you’re iterating over all of the files in that directory (careful though, it’s going to break if any of the filenames contain spaces). This one in particular is iterating over files that start with “mylog”.