Domanda

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.

È stato utile?

Soluzione

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

Altri suggerimenti

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top