this is my entire script below. essentially, I want a user to CD into the directory if he is prompted for, and also, rerun the script when it asks at the end. Everything works great except the end. if you see at the end when asking for cd into directory and asking if you would like to rerun the script, i just have it executing it again. Should I store it in a variable and call it? instead of just have ./search.sh
the error is it saying for cd into the directory, just blank. I know there is a child application, but I am not understanding the concept of it.
and to rerun the script, it is just saying cant fin it
I would probably have a loop rather than recursively calling the script. However, I don't see why that wouldn't work. I notice a couple of things though. First you call the script search.sh in your comments, but in the code, you're calling test.sh. Typo? Also, if the user chooses to cd into the directory, that's it. There's no recursive call in that case, and the script just ends. After the script, the current directory goes back to what it was before the script ran, so making a cd the last thing in a script doesn't have any effect.
Time is the best teacher, but unfortunately, it kills all of its students - Robin Williams. tiny ad: