this is all of the code that i am using. when it asks for the file, i simply enter 'text' without the quotations, which is the name of the file which already contains some text in it. Thanks a lot.
echo
echo "file?"
read $file
echo "Enter the new line to add:"
read newline
echo "$newline" >>...
Hi, i have the following code, but when i enter the word to add, the following error appears line 6: $file: ambiguous redirect. Does anyone know why?
echo "enter file"
read file
echo "enter word to add"
read word
echo "$word" >> $file
Thanks for your help.
thanks for your reply. Would this work in the same way to find the number of sentences in the text by separating any text after a full stop onto a new line and then using grep to count the number of lines with a full stop? thanks again.
i'm trying to get the user to enter a word, then the script should search for how many of that word exists in the file. For example, I want it to say, "There are 7 'and' words in the file", or "There are 5 'the' words in the file" etc...
I have the following which I used to find a specific...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.