← Back to team overview

sslug-teknik team mailing list archive

Re: Bash alias spørgsmål

 

Jesper Honig Spring <sslug@xxxxxxxxxxxxxxx> writes:

> jeg har et alias problem, som kan illustreres på følgende måde. Følgende
> alias:
>
> alias xxx='echo $1; echo $1'

bash-aliasser tager ikke argumenter. Du kan se det ved for eksempel
prøve følgende

$ alias xxx='echo $1; echo $1 eol;'
$ xxx foo

eol foo
$

Du skal istedet lave en funktion

xxx() {
    echo $1
    echo $1
}

Det gør som du ønsker.

-- 
 Peter Makholm     |      There are 10 kinds of people. Those who count in
 peter@xxxxxxxxxxx |                            binary and those who don't
 http://hacking.dk |                                                      


Follow ups

References