Right,
the only difficulty is 'if statement'.
in bash you could do something like this:
if cmd1 args1 && cmd2 args2 && cmd3 args3
then
#some code
fi
But for fish it is not the case, because 'if' is the command as well.
It took some time for me to understand that I can do this in fish in the
following way:
cmd1 args1; and cmd2 args2
if and cmd3 args3
#some code
end
regards,
Maxim
On Fri, 01 Jun 2012 04:22:56 +0400, Philip Ganchev
<[email protected]> wrote:
> On Thu, May 31, 2012 at 12:14 AM, ridiculous_fish
> <[email protected]> wrote:
>>
>> On May 30, 2012, at 1:17 PM, Maxim Gonchar wrote:
>>
> [...]
>> 4. I think fish is doing the right thing with "false ; and sdlkfjsdklf".
>> That semicolon means that the 'and' is the beginning of a new
>> statement, and
>> fish agrees with other shells (including fish trunk) that this is an
>> error.
>> Remove the semicolon ("false and sdlkfjdsklf") and it does not error.
>>
>> This statement confronts all my fish experience. I use fish as default
>> shell
>> for the long time.
>> What about "echo 123 and echo 234" and "echo 123; and echo 234"?
>
> If I might add to that: having 'and', 'or' and 'not' as separate
> commands seems conceptually simpler to me. Also, it is more useful for
> interactive use, because you can start executing a command like 'foo'
> and then add 'and bar'.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users