Wednesday, 28 August 2013

Explain the use of following variables: IFS, PATH, LOGNAME, PROMPT

IFS (Internal Field Separator)
IFS can be redefined to parse one or more lines of data whose fields are not delimited by the default white-space characters. IFS contains a string of characters that are used as word separators in the command line. The string normally consist of the space, tab and the new line character.
PATH
PATH is a list of directories that the shell uses to locate executable files for the commands.
LOGNAME
This variable shows your user name. when you wander around in the file system, you may sometimes forget your login name. LOGNAME is used when in shell script which require to know just the username before deciding what it should do.
Usage: logname
Print the name of the current user.

No comments:

Post a Comment