Timeline for Run another command before running the command the user wants to run
Current License: CC BY-SA 3.0
9 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 27, 2015 at 22:57 | comment | added | jw013 | @IonicăBizău The reason there is no infinite recursion is given in the bash manual: The first word of the replacement text is tested for aliases, but a word that is identical to an alias being expanded is not expanded a second time. This means that one may alias ls to "ls -F", for instance, and Bash does not try to recursively expand the replacement text | |
| Jan 26, 2015 at 1:09 | comment | added | anon | @HaukeLaging Never mind. I'll ask my own question if I absolutely need to know but until then I'd rather not piggyback on another. | |
| Jan 26, 2015 at 1:02 | comment | added | Hauke Laging | @QPaysTaxes You can use & indeed but I don't get the argument you make from that. | |
| Jan 25, 2015 at 20:42 | comment | added | anon | Would joining the two with an & also work? That would also ensure that the user's command is only run if the custom one works, right? | |
| Jan 25, 2015 at 19:53 | comment | added | David Z | @IonicăBizău any given "alias expansion rule" is only used once. | |
| Jan 25, 2015 at 18:19 | comment | added | jamesqf | You might instead try alias ls 'echo "Hello World!"; /usr/bin/ls' | |
| Jan 25, 2015 at 16:58 | vote | accept | Ionică Bizău | ||
| Jan 26, 2015 at 7:43 | |||||
| Jan 25, 2015 at 16:58 | comment | added | Ionică Bizău | Ha! I supposed this will create an infinite cycle! But why doesn't it create an infinite loop? | |
| Jan 25, 2015 at 14:38 | history | answered | Hauke Laging | CC BY-SA 3.0 |