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}## var ##${txtrst}" 

T_D_L=/home/
T_D=$T_D_L

after that I run echo $T_D_L but nothing happens

Tak
  • 3,536
  • 11
  • 51
  • 93
  • 1
    possible duplicate of [Can a shell script set environment variables of the calling shell?](http://stackoverflow.com/questions/496702/can-a-shell-script-set-environment-variables-of-the-calling-shell) – tripleee Aug 11 '14 at 05:40

1 Answers1

0

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

Tak
  • 3,536
  • 11
  • 51
  • 93