I have a generic filepath- /home/aa/bb/cc/d.txt and want to script something like this-
so in the script, one thing would be for it to take that /path/to/testcase/d.txt
And split it into
working_dir = /path/to/testcase
netlist = d.txt
then the script would do:
cd $working_dir
<run $netlist>
I want to use basename and dirname to split the filepath here. Can anyone help me with this?
Expecting to run a testcase from a particular file path but making the command line generic for everyone to use.
We have 2 native linux commands
basename&dirnamewhich will be perfect for your requirement. These commands comes with packagecoreutils.Here is an example:
Hope this helps you.