What is the search path for a shell? What is the name of the shell variable that is used to maintain the search path for the Bourne Again and TC shell? Where (in which file) is this variable typically located? What is the search path set to in your environment? How did you find out? Set your search path so that your shell searches your current and your ~/bin directories while looking for a command that you type. In what order does your shell search the directories in your search path? Why?
What will be an ideal response?
The search path for a shell is the sequence of directories that the shell searches (one by one) to locate an external command. The Bourne Again shell use the variable called PATH for maintaining its search path and the TC shell uses the variable path for the same purpose.
You can use the echo $PATH command in Bash and echo $path command in the TC shell to determine the search path for your environment. The search path in our environment is shown in the output of these commands, as shown below.
$ echo $PATH
/usr/sbin:/usr/X11/include/X11:.:/users/faculty/sarwar/bin:/usr/ucb:/bin:/usr/bin:/usr/include:/usr/X11/lib:/usr/lib:/etc:/usr/etc:/usr/local/bin:/usr/local/lib:/usr/local/games:/usr/X11/bin
$
% echo $path
/usr/sbin /usr/X11/include/X11 . /users/faculty/sarwar/bin /usr/ucb /bin /usr/bin /usr/include /usr/X11/lib /usr/lib /etc /usr/etc /usr/local/bin /usr/local/lib /usr/local/games /usr/X11/bin
%
You should run the following command so that your shell searches your current as well as your ~/bin directories while looking for an external command that you type.
$ PATH=$PATH:~/bin:.
$
The order of search is: currently set search path, followed by your ~/bin directory, and then your current directory.
You might also like to view...
Alice provides a means of saving transition classes or objects from one project for reuse in a different project.
Answer the following statement true (T) or false (F)
You can create a macro named ____________________ to display a splash screen form when a database opens.
Fill in the blank(s) with the appropriate word(s).
Suppose you have the following struct definition and typedef statements in your program:
What will be an ideal response? ``` struct N { double d; N *next; }; typedef N* node_ptr; node_ptr p1; Now suppose further that p1 points to a node of type N in a linked list. Write code that makes p1 point to the next node on the linked list. ```
The Flip Vertical transform command produces a mirror image along the horizontal axis.
Answer the following statement true (T) or false (F)