Difference between revisions of "Bash Scripts"
Jump to navigation
Jump to search
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
==University of Florida High Performance Computing Center== | ==University of Florida High Performance Computing Center== | ||
* [[lustre-server]] | * [[lustre-server]] | ||
| + | ==Shell Tricks== | ||
| + | To get the name of the script sans the path: [http://linux.ucla.edu/manual/bash-2.05a/html_node/bashref_29.html#SEC29 Explanation] | ||
| + | |||
| + | SCRIPT=${0##*/} | ||
| + | ==Tar Tricks== | ||
| + | Copy files from one location to another using tar: | ||
| + | |||
| + | tar cf - . | (cd /somewhere ; tar xvfBp -) | ||
Latest revision as of 21:21, 15 February 2017
University of Florida High Performance Computing Center
Shell Tricks
To get the name of the script sans the path: Explanation
SCRIPT=${0##*/}
Tar Tricks
Copy files from one location to another using tar:
tar cf - . | (cd /somewhere ; tar xvfBp -)