Skip to main content
The 2024 Developer Survey results are live! See the results

Timeline for Display alias with substitutions

Current License: CC BY-SA 4.0

14 events
when toggle format what by license comment
Mar 8, 2023 at 23:29 vote accept JS.
Mar 8, 2023 at 23:29 answer added JS. timeline score: 0
Feb 17, 2023 at 21:08 comment added JS. No, $TARGET_DIR is just the repository I'm working out of at the time. It changes every few days or so. The directory name is a hash of the git branch name. The whole point is to avoid typing in the long directory name each time. I want to change it in the .bashrc every once in a while and have all my aliases working and copy/pastable on the fly. Displaying functions doesn't resolve substitutions any better than displaying aliases.
Feb 17, 2023 at 19:48 history edited Kusalananda
edited tags
Feb 17, 2023 at 19:37 comment added Kusalananda In your "Additional Example", you want to run the alias 50 times, each time with another TARGET_DIR value? That's literally what turning it into a function that takes the directory as an argument would allow you to do (see the end of my answer below). In fact, since the alias uses $TARGET_DIR unresolved, just changing this variable's value and calling the alias again would probably also work, although using a function would allow you to handle quoting better.
Feb 17, 2023 at 19:29 history edited JS. CC BY-SA 4.0
added 329 characters in body
Feb 17, 2023 at 19:27 answer added MayeulC timeline score: 0
Feb 17, 2023 at 19:21 comment added Kusalananda I still don't understand what it is you want to do. Sorry.
Feb 17, 2023 at 19:16 history edited JS. CC BY-SA 4.0
added 329 characters in body
Feb 17, 2023 at 18:58 answer added Kusalananda timeline score: 0
Feb 17, 2023 at 18:35 comment added JS. The only reason would be aliases are easier to implement. Thanks for the suggestion. I'll try using a function instead.
Feb 17, 2023 at 18:33 comment added Kusalananda Is there a reason you don't make this a shell function instead, with the directory as an argument (possibly with a default value)?
S Feb 17, 2023 at 18:23 review First questions
Feb 17, 2023 at 18:53
S Feb 17, 2023 at 18:23 history asked JS. CC BY-SA 4.0