I am working on a remote server through putty and am trying to set certain environment variables throught something like this
#!/bin/bash
VAR="SOME VALUE"
export $VAR
when I exit the script and run echo on $VAR, I am given a blank line. could you please suggest a way around this.
First you need to export VAR, rather than $VAR.
Plus, I think, you are trying to execute the script from your shell as
You should rather source it as
You can put it in your .bashrc.