Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'OT - A possible solution for odd Terminal behaviors' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
OT - A possible solution for odd Terminal behaviors
Authored by: n8gray on Nov 03, '04 03:25:36PM

alias . ='pwd'
alias ..= 'cd ..'
These are broken. You can't put spaces around the = in alias lines. You have to use:

alias .='pwd'
alias ..='cd ..'
Also, aliases can't take arguments in bash so this won't work:

alias files='find !:1 -type f -print'
Instead use a function:

files () { find $1 -type f -print; }
Be sure to leave a space after the { and put a semicolon after the command. You can also use a multi-line syntax for longer functions:

files () { 
   find $1 -type f -print
   echo "hello world"
}
In this case semicolons aren't necessary since the commands are on individual lines.

Hope this helped.

[ Reply to This | # ]

OT - A possible solution for odd Terminal behaviors
Authored by: webbix on Nov 03, '04 04:31:12PM

Thanks, exactly what I needed.

Hated to lose the functionality I had but did not know enough about it and have wanted to give bash a try since 10.3 came out. I will edit my config and give it a try.



[ Reply to This | # ]