Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • i'm in VM so just testing out. I've tried but It still isn't working properly. This is just a part of my full script. And for some reason whenever I execute one of other options, the "The directory does not exist" shows up. I want it to check just for one of the scripts, not any other. Commented Feb 23, 2015 at 3:32
  • @Hp88 Are you trying to check if the /etc/passwd file exists of the /home directory exists first before copying? Also edit your question and post your full script if it is having problems. I can't speak for the rest of the script not working without seeing it. Commented Feb 23, 2015 at 3:35
  • @Hp88 I also fixed the script. It was wrong. Sorry, it's late and I'm starting to see stars. :D lol Commented Feb 23, 2015 at 3:50
  • Thanks, I tried it, but it still does not tie up to my full script, I edited my entire script. Thanks for your help! Commented Feb 23, 2015 at 4:29
  • @Hp88, I updated my answer with a case statement of your script. I tested it and everything works. See if that works for you. It should give you more flexibility than your nested if-then-else statements. Commented Feb 23, 2015 at 5:06