Created
March 15, 2016 00:56
-
-
Save idettman/27b7d6bb1a8df6d2294b to your computer and use it in GitHub Desktop.
shell copy file content to variable
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
| # Read input file | |
| var str input ; cat "/folder/somefile.txt" > $input | |
| # Remove everything before "foo" | |
| stex "]^foo^" $input > null | |
| # Remove everything after "foo" | |
| stex "^foo^[" $input > null | |
| # now $input contains desired text | |
| echo $input |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment