James G. Sack (jim) wrote:
> John H. Robinson, IV wrote:
> > Carl Lowenstein wrote:
> >> On 6/8/07, Todd Walton <[EMAIL PROTECTED]> wrote:
> >>> On 6/7/07, Carl Lowenstein <[EMAIL PROTECTED]> wrote:
> >>>> Here is a really simple shell script that I wrote for "pdf2up", using
> >>>> their tool.  There are lots of other fancy features that I did not
> >>>> need.
> >>>>
> >>>> [EMAIL PROTECTED] ~]$ cat $(which pdf2up)
> >>>> #!/bin/sh
> >>>> java tool.pdf.Impose -nup 2 -paper letter $*
> >                                                ^^ should be "$@"
> >                                            complete with quotes
> >>> Why not an alias?
> >> A one-line shell script seemed easier at the time.
> >>
> >> Bash aliases don't take arguments, although that would not be problem
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >> in this case.
     ^^^^^^^^^^^^^

I somehow managed to miss that the first time.

> Appending often doesn't do what you want, which is why I mentioned
> functions.
> 
> But, jhriv -- am I remembering correctly that zsh aliases allow args?

That is false.

However, you can do some suffix-type aliases:

% alias -s ps=gv
% *.gv

would exapnd to:
  gv *.ps

then the glob would exapnd:
  gv file1.ps file2.ps file3.ps

You can also do global aliases, that exapnd in ANY position:

% alias -g MESSAGE='Hello, World!'
% echo MESSAGE
Hello, World!

But none of them are args, per se. Shell functions certainly can. As cah
shell script one-liners.

-john


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to