문제

I am setting an environment variable - say ABC - in C shell in SuSe Linux.

My question, are there any difference in following 2 commands?

  1. $setenv ABC "1"
  2. $setenv ABC 1

In both the cases echo gave me the same result.

i.e

$echo $ABC 
1

For me, it looks to be both are same. But I wanted a confirmation to proceed.

도움이 되었습니까?

해결책

No, there are no differences for your example. But csh is rightly considered harmful, so forget about it. Use bash or zsh instead.

My personal preference is to use Posix /bin/sh or else /bin/bash for scripts, and zsh as my interactive login shell

다른 팁

In a nutshell if the value assigned to your environment variable include spaces you will need to use quotes.

Here's a link with more information about shell and environment variables. Search for the setenv on the page.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top