Workspaces/Advanced Features/ws find: Difference between revisions
Jump to navigation
Jump to search
(Created page with "= ws_find - Find Workspace Path = <tt>ws_find</tt> returns the full path to a workspace, useful for scripts and automation. == Basic Usage == $ ws_find myWs This prints the full path to the workspace named <tt>myWs</tt>. == Options == * <tt>-F <filesystem></tt> - Search workspace on specific filesystem * <tt>-l</tt> - List valid filesystem names == Example in Scripts == $ WORKSPACE=$(ws_find myProject) $ cd "$WORKSPACE" This is particularly useful in ba...") |
mNo edit summary |
||
| Line 1: | Line 1: | ||
= ws_find - Find Workspace Path = |
= ws_find - Find Workspace Path = |
||
<tt>ws_find</tt> |
<tt>ws_find</tt> prints the full path to a workspace. Essential for scripts and batch jobs. |
||
== Basic Usage == |
== Basic Usage == |
||
$ ws_find myWs |
$ ws_find myWs # Print workspace path |
||
| ⚫ | |||
This prints the full path to the workspace named <tt>myWs</tt>. |
|||
'''Capture path in variable:''' |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
$ WORKSPACE=$(ws_find myProject) |
$ WORKSPACE=$(ws_find myProject) |
||
$ cd "$WORKSPACE" |
$ cd "$WORKSPACE" |
||
'''In batch jobs:''' |
|||
| ⚫ | |||
<pre> |
|||
#!/bin/bash |
|||
#SBATCH --job-name=my_job |
|||
WORKSPACE=$(ws_find myProject) |
|||
cd "$WORKSPACE" |
|||
./my_program |
|||
</pre> |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
== |
== Check Available Filesystems == |
||
$ ws_find -l |
$ ws_find -l # Show filesystem locations |
||
See [[Workspaces/Advanced_Features/Filesystems|Filesystems guide]] for choosing the right filesystem. |
|||
For more information: <tt> |
For more information: <tt>ws_find -h</tt> or <tt>man ws_find</tt> |
||
Latest revision as of 16:39, 2 December 2025
ws_find - Find Workspace Path
ws_find prints the full path to a workspace. Essential for scripts and batch jobs.
Basic Usage
$ ws_find myWs # Print workspace path
Use in Scripts
Capture path in variable:
$ WORKSPACE=$(ws_find myProject) $ cd "$WORKSPACE"
In batch jobs:
#!/bin/bash #SBATCH --job-name=my_job WORKSPACE=$(ws_find myProject) cd "$WORKSPACE" ./my_program
This is the recommended way to locate workspaces in batch jobs. See Using Workspaces in Batch Jobs.
Options
- -F <filesystem> - Find workspace on specific filesystem
- -l - List available filesystem locations
Check Available Filesystems
$ ws_find -l # Show filesystem locations
See Filesystems guide for choosing the right filesystem.
For more information: ws_find -h or man ws_find