I am writing a script which will pick the last created file for the given process instance.

The command I use in my script is

```
CONSOLE_FILE=`ls -1 "$ABP_AJTUH_ROOT/console/*${INSTANCE}*" | tail -1`

```

but while the script is getting executed, the above command changes to 

```
ls -1 '....../console/*ABP*'

```

because of the single quotes, `*` is not being treated as a wildcard character and it is giving output like:

```
ls -1 $ABP_AJTUH_ROOT/console/*${INSTANCE}* | tail -1
+ ls -1 '/tcusers1/dev/aimsys/devtc1/var/dev/projs/ajtuh/console/*UHMF_RT_1085*'
+ tail -1
ls: /tcusers1/dev/aimsys/devtc1/var/dev/projs/ajtuh/console/*UHMF_RT_1085*: No such file or directory
+ CONSOLE_FILE=''

```

---

it is working on command line after removing ' from the command but not working while using in script as mentioned above

```
tc1@gircap01!DEV:devtc1/Users/RB/AIMOS_CLEANUP_CANSUB> ls -l '/tcusers1/dev/aimsys/devtc1/var/dev/projs/ajtuh/console/*UHMF_RT_1085*'
ls: /tcusers1/dev/aimsys/devtc1/var/dev/projs/ajtuh/console/*UHMF_RT_1085*: No such file or directory
devtc1@gircap01!DEV:devtc1/Users/RB/AIMOS_CLEANUP_CANSUB> ls -l /tcusers1/dev/aimsys/devtc1/var/dev/projs/ajtuh/console/*UHMF_RT_1085*
-rw-r--r-- 1 devtc1 aimsys  72622 Feb 17 20:55 /tcusers1/dev/aimsys/devtc1/var/dev/projs/ajtuh/console/ADJ1UHMINFUL_UHMF_RT_1085_console_20150217_205519.log
-rw-r--r-- 1 devtc1 aimsys 177039 Feb 17 21:02 /tcusers1/dev/aimsys/devtc1/var/dev/projs/ajtuh/console/ADJ1UHMINFUL_UHMF_RT_1085_console_20150217_210203.log

```