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*

13
  • 2
    Where are you running the command? There's no command being executed in your script. Also, the shebang (#!/bin/bash) needs to be the first line of your file, you can't have it in the middle like that. Yes, you can absolutely delete the directory after running the command, but we need to see the actual script you use to be able to help you with it, one that shows us when you execute the command. Commented May 19, 2022 at 11:11
  • The script above rm works! I am just wondering if I can delete a folder after executing through cmd. and is it the right way to do this? Commented May 19, 2022 at 11:51
  • Please edit your question instead of giving more info in the comments. Commented May 19, 2022 at 12:30
  • No, that script won't work. You haven't closed the for loop and the #!/bin/bash is ignored as a comment. Please show us your actual script, including the part where you execute $sbatch so we can understand what you are doing. Commented May 19, 2022 at 12:33
  • Are all people rude over here? @ArtemS.Tashkinov No, my question isn't about whether my script is right or not. I am simply asking if there is a way to delete folders once executing the cmd sbatch. Commented May 19, 2022 at 14:03