LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-02-2009, 08:06 PM   #1
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
Does "env" work the same under all shells?


if I run "env", can I expect the same result regardless of tcsh, csh, bash, ksh, etc?

I've tested a few & it seems to be the same. Is that definitely the case?

I'm seeing:

variable=value1:value2:value3
 
Old 10-03-2009, 12:22 AM   #2
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by BrianK View Post
if I run "env", can I expect the same result regardless of tcsh, csh, bash, ksh, etc?

I've tested a few & it seems to be the same. Is that definitely the case?

I'm seeing:

variable=value1:value2:value3
env is external program not, shell internal command, so you can expect
more or less same result.

But:
1) Different shells may define different additional env variable, so output can be slightly different.
2) None of the shell you listed has env built-in, but it's possible to write one, that will have, and will behave differently.
For example there is program nice and tcsh has built-in nice with different syntax
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to use "xgraph" in the scripts shells with ns2.33 in fc9 messy2010 Fedora 1 01-21-2009 03:56 AM
Any way to get "Alice"; "Call of Duty" series and "Descent 3" to work? JBailey742 Linux - Games 13 06-23-2006 01:34 PM
Difference between "set" and "env"? jdupre Linux - Newbie 2 01-13-2006 04:37 PM
problem "make"ing gtk+ "/usr/bin/env: perl -w" caid Linux - Newbie 8 07-29-2005 04:51 AM
set, env, source & "completely empty environment..." ? na5m Linux From Scratch 1 01-28-2005 03:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration