2

Let's say I have a script:

#!/bin/bash
echo "$1"
if [[ ! $1 ]]; then
    echo "True"
fi
export ABC="/home/aashish"

ABC is not available after the execution of this script. How can I make that variable persist after the execution as well?

ilkkachu
  • 133,243
  • 15
  • 236
  • 397
Aashish P
  • 133
  • 1
  • 5
  • 3
    No way. Have you read [What scopes can shell variables have?](http://unix.stackexchange.com/questions/27555/what-scopes-can-shell-variables-have)? – manatwork Jul 03 '12 at 12:17

1 Answers1

5

source it into current shell session.

poige
  • 6,195
  • 2
  • 30
  • 57