I'm trying to get rid of all of the "|" characters and add a space from an input file that is formatted like this: word|word|number
F=$(curl ftp://ip/pub/text.txt)
cut_stuff(){
# this is where I get confused
cut -d"|" -f "1-3"
}
for i in $F; do
echo $i | cut_stuff
done
As requested, using cut
:
$ echo 1\|2\|3 | cut -d \| --output-delimiter=" " -f 1-
1 2 3