Linux / UNIX Tech Support Forum
This is a discussion on echo command within the Shell scripting forums, part of the Development/Scripting category; can anyone tell me how does echo command work internally, i mean hows it display the text we entered, which ...
|
|||||||
| Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
| Sponsored Links | ||
|
|
|
||||
|
Do you know C programming? Otherwise it will be pretty hard to understand. On other hand you can list all used libraries with the following command:
Code:
ldd /bin/echo
__________________
Vivek Gite Linux Evangelist |
|
|||
|
Quote:
yup, i know d C programming...... r u going to gv me its coding? gr8, welcome for ur answers...... i tried this command, shows the depedencies, but the echo command can work without these files, then how can they be depandency files for echo? |
|
||||
|
No it cannnot run. Your shell finds them and load those file at run time using loader. There is always a program called ld.so and ld-linux.so* which find and load the shared libraries needed by a program such as /bin/echo, prepare the program to run, and then run it.
Almost all linux / UNIX / BSD binaries require dynamic linking. The shared libraries needed by the program are searched for in various places such as /lib, /lib64, /usr/lib and so on. One can also set LD_LIBRARY_PATH. Also, /etc/ld.so.cache file contains a compiled list of candidate libraries previously found in the augmented library path. The dynamic linker can be run either indirectly through running some dynamically linked program or library directly by running as follows: Code:
/lib/ld-linux.so.* /bin/echo "Welcome" I suggest you get Linux kernel programming book. It will explain everything about kernel, loader and much more.
__________________
Vivek Gite Linux Evangelist |
|
|||
|
thankyou very much for ur suggestion. i m doing a research on echo command for my office..... so if u know more abt echo command.... plz tell me , like what can echo do other then displaying text msg.... and many more.....
thnx once again |
|
||||
|
Yes, read the man page for all options:
Code:
man echo
__________________
Vivek Gite Linux Evangelist |
|
|||
|
already tried the options by man page, setting background and foreground colour, setting effects....
can u plz tell me what is himBH ? when i typed command as: # echo $- himBH and it is the same in all system where RHEL5 is running....... |
|
||||
|
It is a special parameter and it is used by bash shell. echo command it used to print the value of $-. A hyphen expands to the current option flags as specified upon invocation, by the set built-in command, or those set by the shell itself (such as the -i). Each character represent set values of shell options. For e.g.
See bash man page (look for Special Parameters section) and set command help page: Code:
help set man bash
__________________
Vivek Gite Linux Evangelist |
|
|||
|
Quote:
echo has a option in man page ie \r for carriage return, what does it mean actually? can u plz gv me some examples to clear it out... |
|
|||
|
Quote:
|
![]() |
| Tags |
| echo , ldd , shell $- variable , shell scripting , shell special parameters |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| UNIX / Linux echo command examples | raj | Getting started tutorials | 8 | 15-11-2009 02:18 AM |
| save command and command output | savook | CentOS / RHEL / Fedora | 1 | 08-05-2009 05:33 PM |
| How to echo with colors? | eawedat | Shell scripting | 3 | 29-04-2009 08:47 PM |
| Automate command execution - reboot-command execution | ganeshp@moris.org | Shell scripting | 2 | 03-12-2008 11:18 AM |
| displaying the executed command then echo the status | warren | Shell scripting | 4 | 29-11-2006 01:56 AM |