0

I want to export many paths using a .sh script. after running it nothing is exported I don't know why. so if anyone can advise. This is the script used:

#!/bin/bash

txtrst=$(tput sgr0) # Text reset
txtred=$(tput setaf 1) # Red
echo "${txtred}## vars ##${txtrst}" 

T_D_L=/home/
T_D=$T_D_L

after that I use echo $T_D_L but nothing happens

4

I was using ./script.sh to run, and the correct way is source script.sh

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.