Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bad substitution in Parameter Expansion
- X-seq: zsh-users 14875
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Bad substitution in Parameter Expansion
- Date: Tue, 23 Feb 2010 19:39:47 -0800
- In-reply-to: <952282.3121.1266966179597.JavaMail.cyyang@xxxxxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <952282.3121.1266966179597.JavaMail.cyyang@xxxxxxxxxxxxxx>
On Feb 23, 6:02pm, Darryl Zurn wrote:
} Subject: Bad substitution in Parameter Expansion
}
} (16:51:%) dt () {
} (function) if [[ -z $1 ]]
} (function if) then
} (function then) print Need arguments
} (function then) else
} (function else) mytext=$1
} (function else) convertcolons=${$mytext//:/\/}
} (function else) convertspaces=${$convertcolons// /\\ }
Look more closely: you have extra "$" on the above two lines.
} (function else) basename=${$convertspaces:h}
} (function else) cd '/Volumes/'$basename
} (function else) fi
} (function) }
I've pointed out the reason for the error message, but I don't vouch for
the correctness of the function otherwise (see Mikael's mail).
Messages sorted by:
Reverse Date,
Date,
Thread,
Author