• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

script not working

Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

Posts: 3063
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic