tulsantide
Technical User
Hi,
I tried the following command outside a script on a Linux system and it works perfect. The same command worked inside the script as well, but it suddenly stopped working. I tried different ways but no luck. Please advice!
=============================================
ls /appl/user1/build|grep "20160307112214"
output is build_20160307112214.war
==========================
shell script
==========================
#!/bin/sh
w_tmstamp=`grep tag /appl/user1/deploy/props/env.properties|awk -F"_" '{print $3}'` # the output of this is 20160307112214
war_file=`ls /appl/user1/build|grep $w_tmstamp` # output of this should be build_20160307112214.war but when i do echo $war_file the output is empty.
I tried the following command outside a script on a Linux system and it works perfect. The same command worked inside the script as well, but it suddenly stopped working. I tried different ways but no luck. Please advice!
=============================================
ls /appl/user1/build|grep "20160307112214"
output is build_20160307112214.war
==========================
shell script
==========================
#!/bin/sh
w_tmstamp=`grep tag /appl/user1/deploy/props/env.properties|awk -F"_" '{print $3}'` # the output of this is 20160307112214
war_file=`ls /appl/user1/build|grep $w_tmstamp` # output of this should be build_20160307112214.war but when i do echo $war_file the output is empty.