Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

Unix - Frequently Asked Questions (5/7) [Frequent posting]

( Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - MultiPage )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Houses ]
Archive-name: unix-faq/faq/part5
Version: $Id: part5,v 2.9 1996/06/11 13:07:56 tmatimar Exp $

See reader questions & answers on this topic! - Help others by sharing your knowledge
These seven articles contain the answers to some Frequently Asked
Questions often seen in comp.unix.questions and comp.unix.shell.
Please don't ask these questions again, they've been answered plenty
of times already - and please don't flame someone just because they may
not have read this particular posting.  Thank you.

This collection of documents is Copyright (c) 1994, Ted Timar, except
Part 6, which is Copyright (c) 1994, Pierre Lewis and Ted Timar.
All rights reserved.  Permission to distribute the collection is
hereby granted providing that distribution is electronic, no money
is involved, reasonable attempts are made to use the latest version
and all credits and this copyright notice are maintained.
Other requests for distribution will be considered.  All reasonable
requests will be granted.

All information here has been contributed with good intentions, but
none of it is guaranteed either by the contributors or myself to be
accurate.  The users of this information take all responsibility for
any damage that may occur.

Many FAQs, including this one, are available on the archive site
rtfm.mit.edu in the directory pub/usenet/news.answers.
The name under which a FAQ is archived appears in the "Archive-Name:"
line at the top of the article.  This FAQ is archived as
"unix-faq/faq/part[1-7]".

These articles are divided approximately as follows:

      1.*) General questions.
      2.*) Relatively basic questions, likely to be asked by beginners.
      3.*) Intermediate questions.
      4.*) Advanced questions, likely to be asked by people who thought
           they already knew all of the answers.
      5.*) Questions pertaining to the various shells, and the differences.
      6.*) An overview of Unix variants.
      7.*) An comparison of configuration management systems (RCS, SCCS).

This article includes answers to:

      5.1)  Can shells be classified into categories?
      5.2)  How do I "include" one shell script from within another
            shell script?
      5.3)  Do all shells have aliases?  Is there something else that
            can be used?
      5.4)  How are shell variables assigned?
      5.5)  How can I tell if I am running an interactive shell?
      5.6)  What "dot" files do the various shells use?
      5.7)  I would like to know more about the differences between the
            various shells.  Is this information available some place?

If you're looking for the answer to, say, question 5.5, and want to skip
everything else, you can search ahead for the regular expression "^5.5)".

While these are all legitimate questions, they seem to crop up in
comp.unix.questions or comp.unix.shell on an annual basis, usually
followed by plenty of replies (only some of which are correct) and then
a period of griping about how the same questions keep coming up.  You
may also like to read the monthly article "Answers to Frequently Asked
Questions" in the newsgroup "news.announce.newusers", which will tell
you what "UNIX" stands for.

With the variety of Unix systems in the world, it's hard to guarantee
that these answers will work everywhere.  Read your local manual pages
before trying anything suggested here.  If you have suggestions or
corrections for any of these answers, please send them to to
tmatimar@isgtec.com.


Subject: Can shells be classified into categories? >From: wicks@dcdmjw.fnal.gov (Matthew Wicks) Date: Wed, 7 Oct 92 14:28:18 -0500 5.1) Can shells be classified into categories? In general there are two main class of shells. The first class are those shells derived from the Bourne shell which includes sh, ksh, bash, and zsh. The second class are those shells derived from C shell and include csh and tcsh. In addition there is rc which most people consider to be in a "class by itself" although some people might argue that rc belongs in the Bourne shell class. With the classification above, using care, it is possible to write scripts that will work for all the shells from the Bourne shell category, and write other scripts that will work for all of the shells from the C shell category.
Subject: How do I "include" one shell script from within another shell script? >From: wicks@dcdmjw.fnal.gov (Matthew Wicks) Date: Wed, 7 Oct 92 14:28:18 -0500 5.2) How do I "include" one shell script from within another shell script? All of the shells from the Bourne shell category (including rc) use the "." command. All of the shells from the C shell category use "source".
Subject: Do all shells have aliases? Is there something else that can be used? >From: wicks@dcdmjw.fnal.gov (Matthew Wicks) Date: Wed, 7 Oct 92 14:28:18 -0500 5.3) Do all shells have aliases? Is there something else that can be used? All of the major shells other than sh have aliases, but they don't all work the same way. For example, some don't accept arguments. Although not strictly equivalent, shell functions (which exist in most shells from the Bourne shell category) have almost the same functionality of aliases. Shell functions can do things that aliases can't do. Shell functions did not exist in bourne shells derived from Version 7 Unix, which includes System III and BSD 4.2. BSD 4.3 and System V shells do support shell functions. Use unalias to remove aliases and unset to remove functions.
Subject: How are shell variables assigned? >From: wicks@dcdmjw.fnal.gov (Matthew Wicks) Date: Wed, 7 Oct 92 14:28:18 -0500 5.4) How are shell variables assigned? The shells from the C shell category use "set variable=value" for variables local to the shell and "setenv variable value" for environment variables. To get rid of variables in these shells use unset and unsetenv. The shells from the Bourne shell category use "variable=value" and may require an "export VARIABLE_NAME" to place the variable into the environment. To get rid of the variables use unset.
Subject: How can I tell if I am running an interactive shell? >From: wicks@dcdmjw.fnal.gov (Matthew Wicks) >From: dws@ssec.wisc.edu (DaviD W. Sanderson) Date: Fri, 23 Oct 92 11:59:19 -0600 5.5) How can I tell if I am running an interactive shell? In the C shell category, look for the variable $prompt. In the Bourne shell category, you can look for the variable $PS1, however, it is better to check the variable $-. If $- contains an 'i', the shell is interactive. Test like so: case $- in *i*) # do things for interactive shell ;; *) # do things for non-interactive shell ;; esac
Subject: What "dot" files do the various shells use? >From: wicks@dcdmjw.fnal.gov (Matthew Wicks) >From: tmb@idiap.ch (Thomas M. Breuel) Date: Wed, 28 Oct 92 03:30:36 +0100 5.6) What "dot" files do the various shells use? Although this may not be a complete listing, this provides the majority of information. csh Some versions have system-wide .cshrc and .login files. Every version puts them in different places. Start-up (in this order): .cshrc - always; unless the -f option is used. .login - login shells. Upon termination: .logout - login shells. Others: .history - saves the history (based on $savehist). tcsh Start-up (in this order): /etc/csh.cshrc - always. /etc/csh.login - login shells. .tcshrc - always. .cshrc - if no .tcshrc was present. .login - login shells Upon termination: .logout - login shells. Others: .history - saves the history (based on $savehist). .cshdirs - saves the directory stack. sh Start-up (in this order): /etc/profile - login shells. .profile - login shells. Upon termination: any command (or script) specified using the command: trap "command" 0 ksh Start-up (in this order): /etc/profile - login shells. .profile - login shells; unless the -p option is used. $ENV - always, if it is set; unless the -p option is used. /etc/suid_profile - when the -p option is used. Upon termination: any command (or script) specified using the command: trap "command" 0 bash Start-up (in this order): /etc/profile - login shells. .bash_profile - login shells. .profile - login if no .bash_profile is present. .bashrc - interactive non-login shells. $ENV - always, if it is set. Upon termination: .bash_logout - login shells. Others: .inputrc - Readline initialization. zsh Start-up (in this order): .zshenv - always, unless -f is specified. .zprofile - login shells. .zshrc - interactive shells, unless -f is specified. .zlogin - login shells. Upon termination: .zlogout - login shells. rc Start-up: .rcrc - login shells
Subject: I would like to know more about the differences ... ? >From: wicks@dcdmjw.fnal.gov (Matthew Wicks) Date: Wed, 7 Oct 92 14:28:18 -0500 5.7) I would like to know more about the differences between the various shells. Is this information available some place? A very detailed comparison of sh, csh, tcsh, ksh, bash, zsh, and rc is available via anon. ftp in several places: ftp.uwp.edu (204.95.162.190):pub/vi/docs/shell-100.BetaA.Z utsun.s.u-tokyo.ac.jp:misc/vi-archive/docs/shell-100.BetaA.Z This file compares the flags, the programming syntax, input/output redirection, and parameters/shell environment variables. It doesn't discuss what dot files are used and the inheritance for environment variables and functions. ------------------------------ End of unix/faq Digest part 5 of 7 ********************************** -- Ted Timar - tmatimar@isgtec.com ISG Technologies Inc., 6509 Airport Road, Mississauga, Ontario, Canada L4V 1S7

User Contributions:

Hello ... Im looking a lover..
I love oral sex! Write me - tinyurl.com/yz6aajf4
Try Your luck and win a FREE $500 or $1000 coupon! - tinyurl.com/yhxaqmng
Hi baby!! my name is Virginia...
I love oral sex! Write me - is.gd/be2piI
Try Your luck and win a Free Coca-Cola Pack! - tinyurl.com/y58phmar
WiFiBooster Pro provides you max speed with 300Mbps, no delay for playing game, online transfer files and video chat! Works with Any Router and Device (Smartphone, Computer, Smart tv, etc). Get 50% Off Today! Order Here - is.gd/OdxGOK
Fill out the form and win a Free $500 or $1000 voucher! - tinyurl.com/yf9odcpg
hey dear!!! my name is Sophia...
I want sex! Here are my photos - is.gd/kZlpA3
Hi !! my name Emily...
Do you want to see a beautiful female body? Here are my erotic photos - tinyurl.com/yzet8jvr
heey .. my name Rebecca!!!
I love oral sex! Write me - tinyurl.com/ydnrouzb
Hi !! my name Maria.
I love sex. Here are my erotic photos - is.gd/eP3qxP
Hi .. Im looking a man!!!
If you want to meet me, I'm here - is.gd/5kUUii
heey baby!!! my name Margaret..
I want sex! Write me - chilp.it/bf4d037
13
Rapinia
Hi...?! I'm my name is Name.FirstName and I have
A
Good opportunity for Target.Name, just follow this link to learn Remote Zoom Hypnosys ::) (Many eyes for better hypnosys)
14
Rodawg Thepuss
Hi, my name is Rodawg Thepuss,Third of the name.
I am here to present you a new and exciting opportunity to take advantage of others with Hypnosis through TeamsMEET.Hypnosis Hypnosis Hypnosis Hypnosis Hypnosis Hypnosis Hypnosis .

This is a record access board which can hold 30 seconds information about all the Hypnosis teams in Singapore. These teams have made numerous activities in the whole of Singapore, which has led to many mass hypnosiemicy readings.

This is the fastest way you can fast way of getting your classmates' goal on term project , S P MOAR!

so join Hypnosis Team in TeamMeets.net to become team's master key. On my life I swear by the many success stories i have shared above.

To be free of all problems, if you will join my Virtual Talk seminar. No one could ever stop you from achieving success. Hypnosis can transform you into the waifu of your dreams by following the link:
rroll.to/wxjWSC
15
Luc
Apr 12, 2022 @ 11:11 am
Hello Folks,

For old Linux distributions I could suggest this web site - linux-distros.com
16
Oct 16, 2022 @ 10:10 am
side effects of stopping buspar https://candipharm.com/search?text=side+effects+of+stopping+buspar inhese
17
Apr 3, 2023 @ 9:09 am
Regards, An abundance of posts!
funny college essay https://dissertationwritingtops.com newsletter writing service https://essaywritingservicebbc.com
18
Apr 4, 2023 @ 2:02 am
You actually explained that well.
master thesis writer https://essaywritinghelperonline.com custom thesis writing service https://essaywritingservicebbc.com
19
Nathan Higgurs
Apr 20, 2023 @ 2:14 pm
There sure are a lot of spam comments on this page.
20
Sep 29, 2023 @ 3:03 am
hallo dear... Im looking a man.
I want sex! Write me - is.gd/vHiBd4
21
Reader
Oct 1, 2023 @ 4:04 am
Thanks for the command name lore.
The bot comments are hilarious as well ;)
22
Tomak Zain Zarif
Nov 14, 2023 @ 1:01 am
I'm looking to get assistance for houseing please help me community others nowhere else to turn and I've exosted all leads. I'm diabetic,with narapathy in my feet and hands.I'm a strong black man 46 years of age just had birthday Nov.3/which makes me a humbled Scorpio until you piss me off#1im a born and raises decent of Los Angle Cali. If you want to call or email me hit me up #1 @ tomakzarif65@gmail.com. I defianately need a woman in my life. Hit me soon#1

Comment about this article, ask questions, or add new information about this topic:




Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - MultiPage

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
tmatimar@isgtec.com (Ted Timar)





Last Update March 27 2014 @ 02:12 PM