Some basic questions


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Some basic questions
# 1  
Old 10-02-2006
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
# 2  
Old 10-02-2006
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
$

# 3  
Old 10-02-2006
'echo $0' will give you your 'current' shell interpreter.

Last edited by vgersh99; 10-02-2006 at 04:06 PM..
# 4  
Old 10-02-2006
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
>

# 5  
Old 10-02-2006
Why does this happen?
# 6  
Old 10-02-2006
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'].
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Solaris

solaris 10 and a few basic questions

hello, first, I'm quite new to solaris. I've installed solaris 10 basic (item 4 on the install-menue). now I had to realize that I don't have any option for connecting the machine from remote. ssh isn't even installed although I've coosed 'yes' for remote access. no matter what solaris is... (10 Replies)
Discussion started by: fourty2
10 Replies

2. UNIX for Dummies Questions & Answers

some basic questions about unix ..

Hi all today i gone through worst interview of my life that for hour questions were so basic but i never though about them now i am figuring out answers my self but i would appreciate if you ppl help me ... i am listing some of the questions i remember .. 1 ) $ cat a.sh #! /usr/bin/ksh... (4 Replies)
Discussion started by: zedex
4 Replies

3. UNIX for Dummies Questions & Answers

hp-ux basic questions

I have multiple questions How to list or find only Nov month's files? How can I get state of process like running, stop, or sleep etc? How can I check dependences of processes? plz ans any if u can thx regards, Mazhar Hussain (3 Replies)
Discussion started by: mazhar99
3 Replies

4. UNIX for Dummies Questions & Answers

Basic variable questions

when you see something like this export SOMEDATA=.:/somedir/files what does the ".:" mean? I think the the "." alone would mean current directory but the ":" together is kind of new to me. (6 Replies)
Discussion started by: NycUnxer
6 Replies

5. UNIX for Dummies Questions & Answers

Basic Unix Questions

OK, here's a question from a true UNIX newb: How does one make a 20 line file? I'm lost. :confused: OK, I figured it out. :D (0 Replies)
Discussion started by: Kitchen Zinc
0 Replies

6. UNIX for Dummies Questions & Answers

Basic SFTP questions

I'm trying to find out what all is involved with setting up SFTP? 1) Do Solaris machines come with a SFTP server and client already installed. 2) If so would I have to install SFTP clients on windows, if I want to transfer files to a Solaris box? 3) If SFTP doesn't come prepackaged would I... (1 Reply)
Discussion started by: JohnRodey
1 Replies

7. UNIX for Dummies Questions & Answers

basic UNIX questions

Can somebody please tell me a little about UNIX OS. For instance, is it ideal for digital media or how easy is it to get help and support? (3 Replies)
Discussion started by: buk5d
3 Replies

8. Slackware

Basic networking questions.

Hey, I'm new to Linux. I have a few questions about it. I run Slackware. After the installation the Linux installation had problems with my old hardware (network card, sound card) so I removed them and Linux would start. But now, I can't seem to use the network card in Linux because it's not... (3 Replies)
Discussion started by: RellioN
3 Replies
Login or Register to Ask a Question