Zsh Mailing List Archive
Messages sorted by:
global aliases substituting *within* a path
- X-seq: zsh-users 17086
- From: Ronald of Steiermark <austria_rules@xxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: global aliases substituting *within* a path
- Date: Wed, 16 May 2012 13:41:18 +0200
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=yepmail.net; h= message-id:from:to:mime-version:content-transfer-encoding :content-type:subject:date; s=mesmtp; bh=4lBKEP5s8DlJOKYlXyFKIj8 TBZ4=; b=GQZIk4E4b20wcGoSXa3+K8LX6Pk5QmY3RmD8hYP8dA49BDD55unugKN KC66vryyZfpJSKDgqlBwy0dK9c37hMAWc5Td/sz8p4/2gbPGKSX0Tii7dEeZf4lL qZ6noctvz7gLlABnso7FjtVVoTS0PMR6eIEgfn+4zkYGWhQpKTpY=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:from:to:mime-version :content-transfer-encoding:content-type:subject:date; s=smtpout; bh=4lBKEP5s8DlJOKYlXyFKIj8TBZ4=; b=NDIbvpPK0k2f7tOt5jHVSqfJ1Pkz +U1oYdyOz+29yihtbF1e/YtYkSepqgDsDvVQ1Qk6SkLBxGsQZeQ578hzEo8v+MeE 6lWoADcQ8lfScTAHDP2ASUyhWECvH27zo8AO1EiTgw16oya8j99mwCbXsz5kdWOk mnHFYQl5sz3+tic=
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:email@example.com>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
I have a set of directory structures like this:
I'm looking for a way to make typing easier on the command line, in
order to not have to type foo/bar/baz all the time.
Of course I can achieve this by setting a shell variable in my .zshrc:
Then I can do for instance
Now I recently learned about global aliases, which permit alias
substitution to be done within the command line, and I thought that I
maybe could use this. Here was my (failed) attempt:
alias -g X=foo/bar/baz
# Does NOT work at hoped
X is not substituted, because it is not a word on its own (not
surrounded by spaces).
My question: For my problem, do I have to stick with my original
solution (shell variable), or is it a way to do it with aliases, or is
there maybe an even more clever way to achieve my goal?
Ronald Fischer <austria_rules@xxxxxxxxxxx>
There are 10 types of people in the world: those who understand binary and those who don't.
Messages sorted by: