I need to process the shared library dependencies of a library from a bash script. The for command processes word-by-word:
for DEPENDENCY in `otool -L MyApplication | sed 1d`
do
...
done
What is the way to process the results line-by-line?
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.
You should use the
readcommand.See bashref for a description of the read builtin, and its options. You can also have a look at the following tutorial for examples of using
readin conjunction withfor.