This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
wiki:old:customization_tips [2014/08/29 16:29] – [PROMPT BASH for Interactive jobs] bugfix neyron | wiki:old:customization_tips [2014/08/29 16:48] – [oarsh completion] neyron | ||
---|---|---|---|
Line 1201: | Line 1201: | ||
====== Users tips ====== | ====== Users tips ====== | ||
===== oarsh completion ===== | ===== oarsh completion ===== | ||
- | //This tip is from Jerome Reybert.// | + | //Tip based on an idea from Jerome Reybert// |
- | "I wanted a simple way to access another | + | In order to complete |
- | <code bash> | + | |
- | $ cat $OAR_NODEFILE | + | |
- | $ oarsh "one of the nodes" | + | |
- | </ | + | |
- | + | ||
- | bash_completion is a better solution. bash_completion seems to be widely available on g5k nodes. You just have to add these lines in your .bashrc, and then try oarsh <TAB> | + | |
<code bash> | <code bash> | ||
- | function _oarsh_complete_() | + | function _oarsh_complete_() { |
- | { | + | if [ -n " |
- | | + | |
- | | + | local list=$(cat $OAR_NODEFILE | uniq | tr '\n' ' ') |
- | | + | COMPREPLY=($(compgen -W " |
- | } | + | fi |
- | | + | } |
+ | complete | ||
</ | </ | ||
+ | Then try oarsh <TAB> | ||
===== PROMPT BASH for Interactive jobs ===== | ===== PROMPT BASH for Interactive jobs ===== | ||
If you want to have a bash prompt with your job id and the remaining walltime then you can add in your ~/.bashrc: | If you want to have a bash prompt with your job id and the remaining walltime then you can add in your ~/.bashrc: |