...
It can also be given a script containing any number of commands that will be executed sequentially.
Exercises
Warning |
---|
You will only be able to do this exercise if you've logged in with a Pawsey user account. Delegate identities are not allowed to create further delegates. |
Expand | ||
---|---|---|
| ||
pshell login sean ???? delegate exit pshell whoami |
Exercise - script a task to download a file in your directory.
Expand | ||
---|---|---|
| ||
Create a plain text file script1.txt containing:
pshell -i script1.txt |
Exercise - script a task that attempts to perform something that will fail (eg remove a directory that doesn't exist) and correctly report that the script encountered an error.
Expand | ||||
---|---|---|---|---|
| ||||
Run the following script if you have bash ... sorry Windows users (without WSL.)
Which produces:
This would typically be a job script on (eg) Pawsey HPC - where you would be doing all such work in a Linux environment. The idea is that if something in your data setup pipeline fails - don't waste any valuable cpu time on it. |
Exercise - adapt the previous exercise to perform an upload that will succeed (eg upload a file from your local desktop) and correctly report that the operation was successful.
Expand | ||||
---|---|---|---|---|
| ||||
You will need two scripts here, one to run pshell (which would be submitted as a job) and another to supply multiple commands to pshell. The second script is needed as, by default, pshell will try to upload into your current working directory (/projects) which you do not have permission to alter. First script, call it: upload.txt
Then we can run this:
|