Re: Using aliases or functions in bash script
On Sat, Jan 26, 2008 at 12:44:42PM -0500, Daniel Dickinson wrote:
> On Sat, 26 Jan 2008 17:12:56 +0000
> Tzafrir Cohen <tzafrir@cohens.org.il> wrote:
>
> > On Thu, Jan 24, 2008 at 03:55:51AM +0000, T o n g wrote:
> >
> > > I'm wondering if you have read my OP or not. Read it again pls.
> >
> > Yes I have. Use functions. Don't use aliases.
> >
>
> On command-line:
>
> function dt () {
> push +$1
And this should do? Is this supposed to be "pushd"? Why the '+'?
pushd +1?
> }
>
> In test.sh
>
> #!/bin/bash
>
> pwd
> $(dt $(pwd))
> cd /tmp
> popd
> pwd
>
> ./test.sh
> Line 2 errors out.
And those error are?
--
Tzafrir Cohen | tzafrir@jabber.org | VIM is
http://tzafrir.org.il | | a Mutt's
tzafrir@cohens.org.il | | best
ICQ# 16849754 | | friend
Reply to: