Skip to content

Instantly share code, notes, and snippets.

@sshongru
Created April 18, 2013 21:13
Show Gist options
  • Save sshongru/5416276 to your computer and use it in GitHub Desktop.
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
#!/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}
@sshongru
Copy link
Author

sshongru commented May 9, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment