Created
August 8, 2014 11:19
-
-
Save lyuboraykov/8deae849e4812669793a to your computer and use it in GitHub Desktop.
Execute shell command with piping in groovy
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
def command = 'ls | grep foo' | |
def output = ['bash', '-c', command].execute().in.text |
s5unty
commented
Jun 28, 2018
How to call groovy variable inside shell?
def var="test"
def command = '''
ls -l
echo $var
'''
def proc = ['bash', '-c', command].execute()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment