Need help with this portion of a script to create a delimited list:
disks=`df -v | grep /dc/d | awk '{print $1}'`
this gives me a list of drives as:
/du0
/du1
/du2
/du3
I want it to look like /du0|/du1|/du2|/du3
when I echo $disks, it returns:
/du0 /du1 /du2 /du3
I'm guessing these are not spaces between the variables, just how it is being read. How can I set the disks variable to be /du0|/du1|/du2|/du3 so I can read into an array?
Any help would be appreciated.
disks=`df -v | grep /dc/d | awk '{print $1}'`
this gives me a list of drives as:
/du0
/du1
/du2
/du3
I want it to look like /du0|/du1|/du2|/du3
when I echo $disks, it returns:
/du0 /du1 /du2 /du3
I'm guessing these are not spaces between the variables, just how it is being read. How can I set the disks variable to be /du0|/du1|/du2|/du3 so I can read into an array?
Any help would be appreciated.