Why does the following gives the line I am searching:
grep '<appointment-id internal:ref=1.2.3/>' test.xml
OUTPUT is <appointment-id internal:ref=1.2.3/>
While the following breaks it into 2 lines?
a=($(grep '<appointment-id internal:ref=1.2.3/>' test.xml))
for i in "${a[@]}"; do
echo "checking $i"
grep -n "$i" delete.xml
done
The output is:
checking <appointment-id
checking internal:ref=1.2.3/>
The file is:
<note>
<to>Jim</to>
<from>John</from>
<heading>Reminder</heading>
<body>Some text</body>
<appointment-id internal:ref=1.2.3/>
</note>
IFS=$' \t\n'
. see What is the 'IFS'? – αғsнιη Jun 07 '18 at 19:03a+=("$line")
). – ilkkachu Jun 07 '18 at 19:50