
Stefanik
User
Dec 6, 2012, 12:41 AM
Post #9 of 10
(888 views)
|
|
Re: [Laurent_R] Substr on one liners command
[In reply to]
|
Can't Post
|
|
Thanks both of you. I try your code, but it doesn't work:
String="some_date_interval" dateinterval_v=`perl -le '$StringPerl = $ENV{String}; print $String; print $StringPerl;$Substring = substr($StringPerl,0,4); print $Substring;'` but the result is empty. Instead I printout the shell variable and it has the right value. By the way I use a "work-around" writing the variable in a temporary file, then reading that file from perl module. But this is a worst solution.
|