> On Aug 2, 2015, at 5:25 PM, Greg Reagle <greg.rea...@umbc.edu> wrote:
> 
> On Sat, Aug 01, 2015 at 01:38:02PM -0600, @lbutlr wrote:
>> I was hoping the list was more active
> 
> FYI, the GitHub site at https://github.com/fish-shell/fish-shell/issues is 
> very
> active with bug reports and feature requests.

Yes, but I am looking more for “How-to” or “getting -started”. I haven’t used 
it enough to request anything or even know if something might be a bug.

> Anyway, is there any sort of writeup anyone’s done on something like “fish
>> for bash users” or similar?
> 
> The comparison at http://hyperpolyglot.org/unix-shells is good.  Also, have 
> you
> read the FAQ at http://fishshell.com/docs/current/faq.html and the tutorial at
> http://fishshell.com/docs/current/tutorial.html?

I’ve read the tutorial, and skimmed the FAQ.

>> fish seems to have some different ideas about how to do things (preferring
>> functions in individual files over aliases or functions in a single rcfile
>> for one)
> 
> That's the default way, but you don't have to do it that way.  You can have 
> all
> of your functions in one file if you like.  You could put them all in
> config.fish.  Fish supports the source command, so you can group them into
> files however you like.

Right. I meant to say that it might be better to try fish “the fish way” as 
opposed to just trying to duplicate my bash setup.

>> Also, I’m not sure what the advantage is to creating a whole lot of files
>> each containing one to three lines in the functions folder.
> 
> My guess is: The functions can be auto-loaded on first use that way, a
> performance gain over loading them all at start-up no matter whether they get
> used.

That makes sense.

>> function gbz () {
>>  for i in `ls | grep ".bz2"` ; do bzgrep -H "$*" $i; done
>> }
>> 
>> If I am understanding the documentation, this would be rewritten into 
>> …/functions/gbz.fish as
>> 
>> function gbz
>>  for i in *.bz2
>>    bzgrep -H $argv $i
>>  end
>> end
> 
> That looks right to me, but I haven't checked it.  FYI, you can have the for
> loop in fish in one line if you'd like--use semicolons.  E.g.
> 
>    for i in (seq 5) ; echo $i; end
> 
>> Yes? How to I pass all the args properly escaped or quoted? Just “$argv” like
>> in the original?
> 
> In fish, you just use $argv unquoted.  This is exemplified in the tutorial.

That’s what i thought, but if I’m using bash and type

% gbz text1 text2 

I get results in the bz2 files for “text1 text2” while with fish I get:

> gbz text1 text2

bzip2: Can't open input file text2: No such file or directory.

and then it greps the files for text1.

> 
>> What if I wanted to check that there was only one argv? Or similarly what if
>> I wanted to parse argv[1] and argv[2] separately?
> 
> Use count.  Again, see the tutorial.  Example
>    for i in (seq (count $PATH)); echo $i : $PATH[$i]; end

Ah. The tutorial just has count $PATH to count the number of elements in the 
$Patch variable.

the reliance on web to config some settings is a bit of an issue. A lot of my 
work in the shell is to remote machines, so setting up Things via a web 
interface simply doesn’t work.

-- 
You start a conversation you can't even finish it
You're talkin' a lot, but you're not sayin' anything
When I have nothing to say, my lips are sealed
Say something once, why say it again?


------------------------------------------------------------------------------
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to