Re: Handy Bash alias script

2007-01-26 Thread Jörg-Volker Peetz
[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

Re: Handy Bash alias script

2007-01-22 Thread Wayne Topa
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

Re: Handy Bash alias script

2007-01-22 Thread Wayne Topa
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

Re: Handy Bash alias script

2007-01-21 Thread Wesley J. Landaker
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 --

Re: Handy Bash alias script

2007-01-21 Thread Wesley J. Landaker
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

Re: Handy Bash alias script

2007-01-20 Thread [EMAIL PROTECTED]
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

Re: Handy Bash alias script

2007-01-20 Thread Wayne Topa
[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

Re: Handy Bash alias script

2007-01-19 Thread [EMAIL PROTECTED]
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

Re: Handy Bash alias script

2007-01-19 Thread Wayne Topa
[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

Re: Handy Bash alias script

2007-01-19 Thread [EMAIL PROTECTED]
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="

Re: Handy Bash alias script

2007-01-19 Thread cassiano
[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

Re: Handy Bash alias script

2007-01-18 Thread Roberto C. Sanchez
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