[cs631apue] How *nix commands support regex ?

Minhui Gu mgu1 at stevens.edu
Sat Sep 7 09:26:15 EDT 2013


It's true. I tried to printf all argv and found them already expanded in
the output.
Maybe we should look into a real shell source for details.

-Minhui


On Fri, Sep 6, 2013 at 10:32 PM, Nick Smith <nsmith1 at stevens.edu> wrote:

>  Hongyi,
> This expansion is handled in the shell, before the command is executed.
> For example, with the following:
> $ tree test
> test
> ├── a
> ├── b
> └── c
>
> 0 directories, 3 files
> $ cp test/* /tmp
>
> cp here receives 4 parameters,
> test/a
> test/b
> test/c
> /tmp
>
> Hope that helps
> -Nick
>
>
> On 09/06/2013 09:15 PM, Hongyi Shen wrote:
>
> Sorry, it's me again.
> When comes to the commands like ls, rm, mv, cp, how do they handle the
> operands with regular expressions? Is there a library contains regex parser
> or something like that?
>
>  I failed to found that in source code or search on Google. I tried to
> use strace, but it only present system calls.
>
>
>  Hongyi Shen.
>
>
>
> _______________________________________________
> cs631apue mailing listcs631apue at lists.stevens.eduhttps://lists.stevens.edu/mailman/listinfo/cs631apue
>
>
> _______________________________________________
> cs631apue mailing list
> cs631apue at lists.stevens.edu
> https://lists.stevens.edu/mailman/listinfo/cs631apue
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.stevens.edu/pipermail/cs631apue/attachments/20130907/53805a70/attachment.html>


More information about the cs631apue mailing list