c - implementing globbing in a shell prototype -
i'm implementing linux shell weekend assignment , having problems implementing wilcard matching feature in shell. know, shells complete language themselves, e.g. bash, ksh, etc. don't need implement complete features control structures, jobs etc. how implement *
?
a quick analysis gives following result:
echo *
lists files in current directory. logical manifestation of shell? mean, not considering language-specific features of bash, shell does, internally? replace *
files in current directory matching pattern?
also have heard perl compatible regular expression , seems complex use third party library.
any suggestions, links, etc.? try @ source code well, bash.
yes, that's shell does. replace '*'
characters files , folder names in cwd
. in fact basic regular expressions supporting '?'
, '*'
, matching file , folder names in cwd
. remark backslashed \*
, '*'
enclosed between simple or double quotes '
or "
not replaced (backslash , quotes removed before passing command executed).
Comments
Post a Comment