# Unable to create output/error file with current time as filename

**URL:** <https://community.openpbs.org/t/unable-to-create-output-error-file-with-current-time-as-filename/3510>\
**Category:** Developers\
**Created:** [April 18, 2023, 1:03am UTC](https://community.openpbs.org/t/unable-to-create-output-error-file-with-current-time-as-filename/3510 "2023-04-18T01:03:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hrishi96](https://avatars.discourse-cdn.com/v4/letter/h/e36b37/32.png) [@hrishi96](https://community.openpbs.org/u/hrishi96)\
**Post date:** [April 18, 2023, 1:03am UTC](https://community.openpbs.org/t/unable-to-create-output-error-file-with-current-time-as-filename/3510/1 "2023-04-18T01:03:46Z")

</div>

I have tried multiple ways to save the output and error file to get current time as file names of respective files still couldnt match the expected outcome.

```auto
#!/bin/bash
#PBS -l select=1:ncpus=2:mem=1GB,walltime=00:02:00
#PBS -N PBS_test
#PBS -V
#PBS -o "path_to _dir/output_$(date +%Y%m%d_%H%M%S).log"
#PBS -e "path_to _dir/error_$(date +%Y%m%d_%H%M%S).log"
#PBS -q queue
#PBS -v CONTAINER_IMAGE=docker_img

#rest of my PBS commands.

current o/p: output_$(date +%Y%m%d_%H%M%S).log
expected o/p: output_<current date>_<current time>.log

same goes with the error file.
```

---

<div class="post-metadata">

**Author:** ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)\
**Post date:** [April 18, 2023, 2:21pm UTC](https://community.openpbs.org/t/unable-to-create-output-error-file-with-current-time-as-filename/3510/2 "2023-04-18T14:21:29Z")

</div>

You can do variable subsitution but evaluation is not supported.  
Our forum collegues would voice in otherwise
