I am adding a variable that I want to be exported every time I run a terminal window. The problem is that it points to a file or directory that is not made at this time. But I want the bash to load and export the variable anyways because when I use it the file/folder will be there.
the variables
export ports=$(awk -F "/" 'BEGIN {ORS=","} /\/tcp/ {print $1}' nmap/initial.nmap | sed 's/,$//')
export portsf=$(awk -F "/" 'BEGIN {ORS=","} /\/tcp/ {print $1}' nmap/full.nmap | sed 's/,$//')
error messages:
awk: cmd. line:1: fatal: cannot open file `nmap/initial.nmap' for reading (No such file or directory)
awk: cmd. line:1: fatal: cannot open file `nmap/full.nmap' for reading (No such file or directory)
Is there any way to make this work through the bashrc or am I going to have make an alias that will export the variable I want each terminal session?
thanks for your time.
ports. You'll have to wait untilnmap/*.nmapexist to define the variables.