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

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -