On 4/17/06, ray hammond <[EMAIL PROTECTED]> wrote:
>
>
>
> Thanks, is that a conscious decision for fish to operate that way?
Yes, it is.
{} is used for brace expansion in fish, just like in e.g. bash:
a{foo,bar}b -> afoob abarb
Bash only performs brace expansion when a comma is present between the
braces, while fish always does this. In general, I dislike having ad
hoc rules for when operator expansion is performed. If fish sees a
'{', it will expect to find a '}', and will brace expand anything
between the two braces. This avoids the (in my opinion) confusing
things that happen with e.g. 'echo {Hello,Good bye}', since the rules
for when expansion takes place are simple and clear. Another reason
why the brace syntax can't easily be changed is because fish uses
braces to express grouping. $foobar expands to the value of the
variable named foobar, while {$foo}bar expands to the value of the
variable named foo, and appends the string bar to that value. The
braces above are simple brace expansion braces.
>
> I like the concept of fish and it would be great if shell would support this
> command, minus the quotes, for cross-shell compatibility.
It would be nice to be as compatible as possible. There have been
debates on the mailing list on how compatibility should be weighed
against a good, clean syntax. It's a matter of opinion, but since
there is an easy, universal workaround (always use quotes), I don't
think this is a major issue.
>
> I have commands similar to this in several shell scripts, across several
> systems, hence changing each to include the quotes would be a bit of a
> headache.
Perhaps a simple sed script like 'sed -i -e 's/{}/\'{}\'/' *.sh' would work?
>
> >On Sunday 16 April 2006 12:51, ray h wrote:
>
> >> I running suse 10 OSS, I have experienced a problem using the find
> command
>
> >> below
>
> >>
>
> >> find . -mtime +1 -exec file {} \;
>
> >>
>
> >> Using a bash or csh shell I get the following results:
>
> >>
>
> >> ./access_log: ASCII text
>
> >> ./rc.out: ASCII English text
>
> >> ./error_log: ASCII text
>
> >>
>
> >>
>
> >> Using fish, version 1.21.4, I get the following:
>
> >>
>
> >> cannot open `' (No such file or directory)
>
> >> cannot open `' (No such file or directory)
>
> >> cannot open `' (No such file or directory)
>
> >>
>
> >> What am I doing wrong, or is this a problem with fish?
>
> >
>
> >Try putting {} in quotes: '{}'
--
Axel
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users