I have the string below:
/a585/app/data/CCN_text/CCN_split_files/ccn.email.list.file07 | /svr00c8/n585 | /a585/app/data/CCN_text | /a585/app/data/CCN_text | /a585/app/data/muttrc | 153.2.254.229 | /a001/odbi_land/ondemand/download/scriptload | DVLP | cmodappl | ondemand
I am beginner to Linux. How can I separate by using "|" as delimiter and assign in a variable? I am passing the entire string as parameter and need to split\cut the fields separately.
For example:
function()
{
while read -r record; do
## here i need the fields to cut the fields and assign to a variable #####
done < $0
}
bash -c function "/a585/app/data/CCN_text/CCN_split_files/ccn.email.list.file07 | /svr00c8/n585 | /a585/app/data/CCN_text | /a585/app/data/CCN_text | /a585/app/data/muttrc | 153.2.254.229 | /a001/odbi_land/ondemand/download/scriptload | DVLP | cmodappl | ondemand"
When I tried the above example it throws an error $0: ambiguous redirect.