• Post Reply Bookmark Topic Watch Topic
  • New Topic

script not working  RSS feed

 
william chaple
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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




 
Greg Charles
Sheriff
Posts: 3015
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!