Hi unix Gurus,
I am really new to Unix Scripting. Please help me to create a shell script which reads the xml file and from that i need to fetch a particular information.
For example
#!/bin/bash
F=0
while read line
do
[[ ! "$line" =~ ^\<SOURCE[[:space:]] ]] && continue
for attr in $line
do
if [[ "$attr" =~ ^NAME$ ]]
then
F=1
continue
fi
if [ $F -eq 1 ]
then
attr="${attr%\"*}"
printf "SOURCE -> %s\n" "${attr#*\"}"
F=0
fi
done
done < file.xml