How does shell work?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users How does shell work?
# 1  
Old 03-04-2008
How does shell work?

I have a silly question here.

Under the shell prompt, when I launch a command (if the command is not part of shell, like 'awk') , how does the shell work?

I don't understand that if the command is not part of or supported by the shell, how does the shell action on this occassion?
# 2  
Old 03-04-2008
Got this from google search... hope it help to understand...

A Unix shell, also called "the command line", provides the traditional user interface for the Unix operating system and for Unix-like systems. Users direct the operation of the computer by entering command input as text for a shell to execute.
# 3  
Old 03-04-2008
Hi.

Text and references at Command line interface - Wikipedia, the free encyclopedia ... cheers, drl
# 4  
Old 03-04-2008
The shell has:
- a Interpretive Programming Language
- Environment settings
- Variable assignment and substitution capabilities
can
- execute / substitute commands
- use pipeline
- redirect I/O
etc...

>I don't understand that if the command is not part of or supported by the shell, how does the shell action on this occassion?
For awk isnt an internal command the shell will search an executable called awk since that is what you entered at the STD input (the keyboard) using a search path you have in your env: the variable PATH, the first one found will be executed...
If the program could not be found, the shell will say so at your STD output (most certainly the display unit above the keyboard)
Simple no?
# 5  
Old 03-05-2008
The shell forks, execs and waits for an external command such as awk to complete.

Do a Web seach "simple command line shell" and you will find plenty of examples of simple command line shells online. It is a standard homework assignment for many computer science courses.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

UNIX/Shell function does not work as wished

Hello everyone I really hope you can help me, I can't continue: Im on a project to work with my Server. I wanted to put on my server all data-systems and I did this: df -h The output is a string. How can I turn the string into a table? Dateisystem Größe Benutzt Verf. Verw% Eingehängt auf... (5 Replies)
Discussion started by: anonymuser
5 Replies

2. Programming

Shell copy command don't work

I want copy Files: But cp don't work: shell_exec("cp ".$pfad." ".$genzone); shell_exec("cp ../Chrysanthemum.jpg ../test"); Whats wrong? (3 Replies)
Discussion started by: Linuxmann
3 Replies

3. Shell Programming and Scripting

Shell script to work on dates

Hi Sir/Madam I have a file data.txt like below file_name date_of_creation x 2/10/2012 y 8/11/2010 z 11/3/2013 a 2/10/2013 b 3/10/2013 c ... (4 Replies)
Discussion started by: kumar85shiv
4 Replies

4. UNIX for Dummies Questions & Answers

How to work command 'cd' in shell script?

I have simple script. like that, I am working on /usr/local/src and also under src folder there is a ft folder #!/bin/ksh #!/bin/bash dirpath="/usr/local/src/ft" echo $dirpath cd $dirpath echo displays ok "/usr/local/src/ft" but that doesn't enter "ft" folder. stays in current... (4 Replies)
Discussion started by: F@NTOM
4 Replies

5. AIX

AIX Shell script does not work

Hi. I created schell script for sending messages to some processes in AIX: #!/bin/sh BSE=/infor/ERPLN/bse BSE_TMP=/infor/ERPLN/bse/tmp export BSE BSE_TMP for i in `ps -eo pid,comm | grep bshell | cut -f 1 -d " "` do /something $i done Unfortunatelly this script does not work on... (6 Replies)
Discussion started by: giovanni
6 Replies

6. Shell Programming and Scripting

SSH shell script does not work

Hello I have a Zabbix Server were Linux kernel version 2.6.26-2-amd64 is running. now my Question how can i make a script that does: - connect with ssh to a device - get the systeminfo (but only the interfaces, mac adresses, serialnumber and Software version) - write the output in a file ... (18 Replies)
Discussion started by: Fraggy
18 Replies

7. Shell Programming and Scripting

I need to do a work to my job, but i m new in script shell, someone can help with this..

I need to do a work to my job, but i m new in script shell, someone can help with this.. :confused: Description Bsafe The command creates a backup directory of each month at the command line (arguments of the script). The names of directories to copy will always be specified for the... (4 Replies)
Discussion started by: strshel
4 Replies

8. UNIX for Dummies Questions & Answers

more command does not work in bash shell

is there a different command to display contents of a file on the output in bash shell? i tried more and it does not work. (7 Replies)
Discussion started by: npatwardhan
7 Replies

9. Shell Programming and Scripting

Date Format Does not work in Shell

I'm am able to format the date in the unix prompt using NOW=$(date +"%d%m%y"). However, when i put the same format into a shell script, it errors out with the followign. sintax error on line 4: `NOW=$' unexpected. #!/bin/ksh EXP_LOC=/u02/oradata/exports NOW=$(date +"%d%m%y") ... (8 Replies)
Discussion started by: mrx1350
8 Replies

10. UNIX for Dummies Questions & Answers

Free shell account from work office

How do I get a freeshell account from my office @ work? I've tried sdf.lonestar.org with no luck. Tha Geek (1 Reply)
Discussion started by: geek757
1 Replies
Login or Register to Ask a Question