I have a script like,
#/bin/bash -x
LASTBUILD=' 174254491 2018-08-08T11:04:40Z gs://abc/kishor/5.4.0.61/xyz-5.4.0-61.tgz
TOTAL: 46 objects, 7325896651 bytes (6.82 GiB)'
echo "this is the LASTBUILD ============== $LASTBUILD"
LATESTBUILD=echo $LASTBUILD | cut -d ' ' -f 3
echo "this is the LATESTBUILD ############### $LATESTBUILD"
After execution shows result as below,
[root@root ~]# echo $LATESTBUILD
[root@root ~]#
My expected result is as below,
[root@root ~]# echo $LATESTBUILD
gs://abc/kishor/5.4.0.61/xyz-5.4.0-61.tgz
[root@root ~]#
The above code is not working.
PS: Also tried using awk but not worked,
LATESTBUILD=$LASTBUILD | awk -F '/' '{print $5}'
export
so any variable set inside the script are not going to be recognized by the shell after the script exits... – Shadur-don't-feed-the-AI Aug 10 '18 at 06:50