Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am having problems running this command to work in zsh:

my_command -u something -s X:^0  

The command works right away on tcsh, but on zsh I get:

zsh: no matches found -s X:^0

This made me wonder if ^ is to blame. As far as I understand sX:^0 is the value of the argument -s, but zsh seems to expand it and not pass it to my_command in the same way tcsh would do.

Is my understanding correct? If so how can I run the same command in zsh?

share|improve this question
1  
Is the command really called "command"? command in a shell built-in in ZSH. –  jordanm Jan 18 '13 at 19:05
    
Thanks jordanm. Good point (+1). I just updated the OP –  user815423426 Jan 18 '13 at 19:40
add comment

1 Answer 1

up vote 4 down vote accepted

With extendedglob enabled, in zsh, ^ is a the negation globbing operator, so -sX:^0 means any filename starting with -sX: not followed by 0.

You need to quote it (as in '-sX:^0' or -sX:\^0 or -s"X:^0"...) if you don't want it to be interpreted as a globbing operator.

Note that in the Bourne shell and its predecessors, ^ was also a pipe operator so needed quoted as well.

share|improve this answer
    
Thanks. How exactly should I quote this to get the same behavior as in tcsh? Should I fully quote -sX:^0? –  user815423426 Jan 18 '13 at 19:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.