Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible improvements for clean_out_error.sh #35

Open
3 tasks
jypeter opened this issue Nov 28, 2019 · 1 comment
Open
3 tasks

Possible improvements for clean_out_error.sh #35

jypeter opened this issue Nov 28, 2019 · 1 comment

Comments

@jypeter
Copy link

jypeter commented Nov 28, 2019

I have just discovered clean_out_error.sh. It does what is expected, but the following could be improved at some point:

  • [probably easy!] change things so that users get an executable file when they pull it from github
[jypmce@ciclad-ng C-ESM-EP]$ ./clean_out_error.sh PMIP4_6kf3_ref
-bash: ./clean_out_error.sh: Permission denied
[jypmce@ciclad-ng C-ESM-EP]$ chmod +x clean_out_error.sh
[jypmce@ciclad-ng C-ESM-EP]$ ./clean_out_error.sh PMIP4_6kf3_ref
List of files for the cleanup =
[...]
  • [easy!] document the fact that you can optionally specify a comparison directory when cleaning files (very useful in my case, where I copy/clone existing comparisons) at the end of the C ESM EP in a nutshell page
    bash clean_out_error.sh [optional_comparison_directory]
    or, if you have made the file executable
    ./clean_out_error.sh [optional_comparison_directory]
  • [requires some work for later!] you get errors when there are no files to clean, and the script asks you if you want to erase files even if there is nothing to erase. This can probably be dealt with later, possibly by using a python script rather than a shell script, but it can wait. Note that there is a nice way to implement the Linux find command in Python, by using os.path.walk (I must have an example usage somewhere, because it is not very intutive)
[jypmce@ciclad-ng C-ESM-EP]$ ./clean_out_error.sh PMIP4_6kf3_ref
List of files for the cleanup =
ls: cannot access PMIP4_6kf3_ref/*.log: No such file or directory
[...]
ls: cannot access PMIP4_6kf3_ref/*/ferret*.jnl*: No such file or directory
Do you want to remove those files? (y/n - o/n - yes/no - oui/non) =>
 Your answer : no
We stop here
@jservonnat
Copy link
Owner

@jypter yes, a PR please ;)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants