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