Skip to content

Instantly share code, notes, and snippets.

@idettman
Created March 15, 2016 00:56
Show Gist options
  • Select an option

  • Save idettman/27b7d6bb1a8df6d2294b to your computer and use it in GitHub Desktop.

Select an option

Save idettman/27b7d6bb1a8df6d2294b to your computer and use it in GitHub Desktop.
shell copy file content to variable
# 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