This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: latest coolview.tar.gz from Sergey...


Larry Hall wrote:
> If you create bash functions to supplement
> your aliases, be careful!  I'm not sure why but I just found out that a
> bash function defined on 1 line generated a syntax error at the end of
> the file it was included in when I sourced it.  The specific error was
> 
> bash.EXE: /users/lhall/.bash_alias: line 35: syntax error: unexpected end of
> file
> 
> This was hard to track down.  The line that caused it was:
> 
> viw() { start vim.exe "$*" }
> 
> changing it to
> 
> viw()
> {
>         start vim.exe "$*"
> }
> 
> solved the problem for me.  I don't know why or if this is an issue of
> general concern.  

This works (if that helps any):
	viw() { start vim.exe "$*"; }

Maybe bash needs a either a newline or a ; to terminate the line.

Just read the man page a bit on lists:

   Lists
       A list is a sequence of one or more pipelines separated by
       one  of  the  operators ;, &, &&, or ||, and terminated by
       one of ;, &, or <newline>.

and functions:

       [ function ] name () { list; }
              This  defines  a  function named name.  The body
              the function is the list of commands between {  a
              }.   This  list is executed whenever name is spec
              fied as the name of a  simple  command.   The  ex
              status of a function is the exit status of the la
              command  executed  in  the  body.   (See  FUNCTIO
              below.)

-- 
  ,-/-  __      _  _         $Bill Luebkert
 (_/   /  )    // //       DBE Collectibles
  / ) /--<  o // //      http://www.wgn.net/~dbe/
-/-' /___/_<_</_</_    Email: dbe@wgn.net
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]