linux - Environment variable is not setting globally -


i using csh terminal.

.cshrc

setenv $files /home/ec2-user/files 

.login

if [ -f ~/.cshrc ]; . ~/.cshrc fi

i trying echo $files values plink. showing error files: undefined variable

you don't use dollar sign when setting variable, use when refer variable.

setenv files /home/ec2-user/files 

the test command should built-in in csh/tcsh implementations, , has of same functionality you'll see listed under man test.

test -f ~/.cshrc && source ~/.cshrc 

note normally, csh/tcsh run .cshrc or .tcshrc file automatically, before runs .login.


Comments

Popular posts from this blog

python - Best design pattern for collection of objects -

go - serving up pdfs using golang -

python - django admin: changing the way a field (w/ relationship to another model) is submitted on a form so that it can be submitted multiple times -