I have to solve some exercises in Korn Shell, but i'm having some problems. For example:
Write a korn shell script with an alfanumeric string as argument. The script lists the file's names in the current directory that contain the given string as substring and that can be read and written.
I can read the string from standard input and also print on screen the file's names which contain the string, but only if use the name of the file as parameter. I can't search the string among all the regular files in my directory and i have no idea on how to filter files basing on permissions. This is my code:
#!/bin/ksh
echo "Write a string"
read
echo "Files which contain the string are:"
find . -type f | grep -l $REPLY stringhe.rtf
stringhe.rtf is a text file with some random strings created by me.
Thank you and sorry for my bad english.