Reputation: 31
I have file in different server and that name will change.
File: testfile-1.2-12345.sh
,"12345"
is going to change.
How I get chancing text to variable?
In server machine this works and it's prints 12345
:
ls ~/test/testfile* | awk -F'[-.s]' '{print $5}'
But when I do it from jenkins it wont work:
def versio = sh "ssh user@${ip} ls ~/test/testfile* | awk -F'[-.s]' '{print \$5}'"
It prints "12345"
but if I try to print ${versio}
it shows null
.
Upvotes: 1
Views: 5223