The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Basic variable questions NycUnxer UNIX for Dummies Questions & Answers 6 02-28-2008 11:17 AM
Basic Aix Administration Questions... NycUnxer UNIX for Dummies Questions & Answers 2 10-11-2007 09:51 AM
Basic Unix Questions Kitchen Zinc UNIX for Dummies Questions & Answers 0 11-04-2005 03:46 PM
Basic SFTP questions JohnRodey UNIX for Dummies Questions & Answers 1 09-28-2005 06:01 AM
basic UNIX questions buk5d UNIX for Dummies Questions & Answers 3 04-04-2005 11:30 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 10-02-2006
Registered User
 

Join Date: Oct 2006
Posts: 1
Some basic questions

Hi-

Newbie here with some basic questions:

1) I can't get alias to work. I tried alias ll='ls -al', but it doesn't work. When just typing 'alias', the new definition doesn't appear. I'm in a bash shell -- is that the problem. I tried switching to csh, but that didn't seem to help. This brings me to my second question.
2) How can I tell what shell I am in? I thought I was in the bash shell so I typed "csh". The shell prompt remained as $.

Thanks
Reply With Quote
Forum Sponsor
  #2  
Old 10-02-2006
Registered User
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 989
I'm in the BASH shell, and your alias works fine for me. Are you using BASH, or just sh?

Also, are you using these aliases in the shell, or in a script? Aliases are usually turned off in scripts, but you can enable them with 'shopt -s expand_aliases'.

You can tell what shell you're in like this:
Code:
$ echo "${SHELL}"
/bin/bash
$
Reply With Quote
  #3  
Old 10-02-2006
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,029
'echo $0' will give you your 'current' shell interpreter.

Last edited by vgersh99; 10-02-2006 at 12:06 PM.
Reply With Quote
  #4  
Old 10-02-2006
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,029
Quote:
Originally Posted by Corona688

You can tell what shell you're in like this:
Code:
$ echo "${SHELL}"
/bin/bash
$
no, this doesn't work.
Code:
$ echo $0
-bash
$ echo $SHELL
/usr/local/bin/bash
$ csh
>echo $0
csh
>echo $SHELL
/usr/local/bin/bash
>
Reply With Quote
  #5  
Old 10-02-2006
Registered User
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 989
Why does this happen?
Reply With Quote
  #6  
Old 10-02-2006
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,029
quoting ''man bash':
Code:
       SHELL  The full pathname to the shell is kept in this environment vari-
              able.   If  it is not set when the shell starts, bash assigns to
              it the full pathname of the current user's login shell.
'SHELL' holds the user 'login shell' - which does not change when you change your shell interpreter [bash -> csh]. WHereas '$cho $0' gives you your current shell interpreter in a given shell [regardless of your 'login shell'].
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 04:04 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0