Timeline for alias or bash function does not work
Current License: CC BY-SA 2.5
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 19, 2011 at 10:30 | comment | added | wnrph | @gilles The argument is not passed to the alias in the sense you can not effect where the original arguments will be placed in the final command string. It will always be placed at the end. | |
| Mar 18, 2011 at 19:22 | comment | added | Gilles 'SO- stop being evil' | @geekosaur, @artistoex: Yes, you can pass an argument to an alias, and in fact it's commonly used. Here, $2 and $9 are unprotected when the alias is defined. See my answer for the full story. | |
| Mar 18, 2011 at 18:58 | comment | added | wnrph | @geekosaur oh, yes, of course. I haven't looked at it that way. | |
| Mar 18, 2011 at 18:53 | comment | added | geekosaur | Actually, because $2 and $9 are inside single quotes, they won't be expanded by the shell but by awk, which uses them as field selectors for the ps output: the uid and the first argument to the command, for Linux ps -f. That said, the failed nested quoting means the shell was expanding them when it shouldn't have been. | |
| Mar 18, 2011 at 18:50 | history | answered | wnrph | CC BY-SA 2.5 |