I'm trying to split sentences in a file into separate lines using a shell script.
Now I would like to split the strings by !, ? or . . The output should be like this :
The file that I want to read from my_text.txt and contains
you want to learn shell script? First, you want to learn Linux command! then. you can learn shell script.
Now I would like to split the strings by " ! " or "? " or "." The output should be like this :
you want to learn shell script First, you want to learn Linux command then you can learn shell script
I used this script :
while read p
do
echo $p | tr "? ! ." "\n "
done < my_text.txt
But the output is:
you want to learn shell script
First, you want to learn Linux command then you can learn shell script
Can somebody help?