Created
April 18, 2013 21:13
-
-
Save sshongru/5416276 to your computer and use it in GitHub Desktop.
A simple BASH script that can parse a substring out of a larger string by stripping off the start then end parts of the string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# parse the test name from the path to the input file (/path/to/myTest.input => myTest) | |
TEST_NAME=${1} | |
TEST_NAME=${TEST_NAME%.input*} | |
TEST_NAME=${TEST_NAME##*/} | |
echo ${TEST_NAME} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Parameter Expansion: http://tiswww.case.edu/php/chet/bash/bashref.html#SEC31