I'm fairly new to bash scripting. I'm trying to create a directory with a timestamp and then cd into the directory. I'm able to create a directory and can cd into it the directory with one command.
mkdir "build" && cd "build"
I can create the directory with data then cd into it.
mkdir date '+%m%d%y'
&& cd date '+%m%d%y'
I am able to create this dir and cd into it with one command.
Here is my bash script:
#!/bin/bash
# mkdir $(date +%F) && cd $(date +%F)
mkdir build_`date '+%m%d%y'` && cd build_`date '+%m%d%y'`
I need to create the directory with build_date '+%m%d%y'
in the title then cd into that folder.
I've looked online but am unable to come up with a solution.
Thank you.