Changes between Version 2 and Version 3 of Documentation/UserGuide/ShellScript
- Timestamp:
- 2020-02-28T17:59:10+01:00 (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Documentation/UserGuide/ShellScript
v2 v3 1 1 = How to write a shell script = 2 2 Author: S.Luyssaert 3 Last revised: 2020/02/28, P. Maugis 3 4 4 5 == A super simple script for recurring tasks == 5 We want to make a script that deletes all the history and restart files from ORCHIDEE so that we can run the next simulation within the same file structure . We will call the command 'clean'.6 We want to make a script that deletes all the history and restart files from ORCHIDEE so that we can run the next simulation within the same file structure with the same starting time. We will call the command ''clean.sh''. 6 7 7 open an editor for the command name i.e. clean 8 Open an editor for the command file, i.e. 'clean.sh' 8 9 {{{ 9 10 emacs ../bin/clean.sh 10 11 }}} 11 12 12 Write the linux commands in the editor. 13 Write the linux commands in the editor. Here, we selct 'bash' as the shell-interpreter. 13 14 {{{ 14 15 #!/bin/bash … … 21 22 }}} 22 23 23 you can now type ' clean.sh' to execute the linux commands in the file clean.sh24 you can now type ''clean.sh'' to execute the linux commands from the file 'clean.sh'