[EMAIL PROTECTED] wrote:
>
> ...and have it work? Aliases don't support $1 or $@, do they?
>
See bash man-page:
There is no mechanism for using arguments in the replacement
text. If arguments are needed, a shell function should be
used (see FUNCTIONS below).
So somethi
Wesley J. Landaker([EMAIL PROTECTED]) is reported to have said:
> On Saturday 20 January 2007 10:46, Wayne Topa wrote:
> > I like to use real world examples. If you want to play then
> > go ahead.
> >
> > alias pslpt="cat $1 | psnup -2 -pletter | lpr"
>
> This doesn't work in bash, it would be ex
Wesley J. Landaker([EMAIL PROTECTED]) is reported to have said:
> On Friday 19 January 2007 16:33, Wayne Topa wrote:
>
> > They do here
> > alias deps='apt-cache showpkg $1'
> > alias policy="apt-cache policy $1"
> > alias 4page="a2ps --medium=Letter -4 $1"
>
> If you're using bash, these may wor
On Saturday 20 January 2007 10:46, Wayne Topa wrote:
> I like to use real world examples. If you want to play then
> go ahead.
>
> alias pslpt="cat $1 | psnup -2 -pletter | lpr"
This doesn't work in bash, it would be expanded like this:
$ psplt arg1
=> cat | psnup -2 -pletter | lpr arg1
--
On Friday 19 January 2007 16:33, Wayne Topa wrote:
> [EMAIL PROTECTED]([EMAIL PROTECTED]) is reported to have
said:
> > ...and have it work? Aliases don't support $1 or $@, do they?
Aliases don't support arguments *at all* in bash. From the bash docs:
"There is no mechanism for using arguments
On 1/20/07, Wayne Topa <[EMAIL PROTECTED]> wrote:
[EMAIL PROTECTED]([EMAIL PROTECTED]) is reported to have said:
> On 1/19/07, Wayne Topa <[EMAIL PROTECTED]> wrote:
> >[EMAIL PROTECTED]([EMAIL PROTECTED]) is reported to have
> >said:
> >> On 1/19/07, cassiano <[EMAIL PROTECTED]> wrote:
> >> >Why
[EMAIL PROTECTED]([EMAIL PROTECTED]) is reported to have said:
> On 1/19/07, Wayne Topa <[EMAIL PROTECTED]> wrote:
> >[EMAIL PROTECTED]([EMAIL PROTECTED]) is reported to have
> >said:
> >> On 1/19/07, cassiano <[EMAIL PROTECTED]> wrote:
> >> >Why not just
> >> >
> >> >$ echo alias aliasname=\"alia
On 1/19/07, Wayne Topa <[EMAIL PROTECTED]> wrote:
[EMAIL PROTECTED]([EMAIL PROTECTED]) is reported to have said:
> On 1/19/07, cassiano <[EMAIL PROTECTED]> wrote:
> >Why not just
> >
> >$ echo alias aliasname=\"alias commands\" >> ~/.bashrc
[--snip --]
> ...and have it work? Aliases don't suppor
[EMAIL PROTECTED]([EMAIL PROTECTED]) is reported to have said:
> On 1/19/07, cassiano <[EMAIL PROTECTED]> wrote:
> >Why not just
> >
> >$ echo alias aliasname=\"alias commands\" >> ~/.bashrc
[--snip --]
> ...and have it work? Aliases don't support $1 or $@, do they?
>
They do here
alias deps='a
On 1/19/07, cassiano <[EMAIL PROTECTED]> wrote:
Why not just
$ echo alias aliasname=\"alias commands\" >> ~/.bashrc
Well, that would require typing that entire command manually every
time. The idea is to have an alias that makes new aliases. If you
had this in your .bashrc:
alias newalias="
[EMAIL PROTECTED] wrote:
I don't know why I didn't do this sooner. Am I just late to the party? =)
I couldn't figure out a way to do this without using a script. I
wanted to just make a one-line alias to do this with existing shell
commands, but I couldn't figure it out. Let me know if there
On Thu, Jan 18, 2007 at 04:47:12AM -0600, [EMAIL PROTECTED] wrote:
>
> Works great when you just scroll to a command in your history, go to
> the beginning of the line, type newalias, and then put the command in
> quotes. Now you never have to type that long command or dig through
> your history
12 matches
Mail list logo