<html><head></head><body>Oh dear.  Yeah, that would definitely do it.<br>
<br>
The shell won&#39;t expand the second alias because it&#39;s an argument, not a command, from the shell&#39;s perspective.<br>
In bash et al., you might be able to do &quot;alias1 ( alias2 )&quot;.  No clue about tcsh.<br>
<br>
Checking the man pages, bash accommodates this if the final character of the alias is a space (!) but I don&#39;t see anything similar for tcsh.<br>
Using a shell function in bash instead of an alias would also enable the desired behavior, maybe that would work in tcsh, too?<br>
<br>
-Adam<br><br><div class="gmail_quote">On May 5, 2015 1:08:10 AM CDT, Trevor Cordes &lt;trevor@tecnopolis.ca&gt; wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">The plot thickens...<br /><br />I double-checked the exact command I was running when I did the grep...<br /><br />I ran:<br /><br />n19 grep -r foobar /<br /><br />n19 is an alias I've been using forever (and as per last month's RTFM):<br />/bin/nice -19 /usr/bin/ionice -c2 -n7 -t<br /><br />I n19 almost everything long-lasting / non-interactive I run.<br /><br />It just dawned on me: "nah, the shell (tcsh) couldn't be expanding the<br />n19 alias and *not* expanding the grep alias, could it?"<br /><br />Sure enough, after a few tests, it is clear the shell only expands the<br />first alias on the line.  So that means (tada) my grep -r wasn't being<br />run with the --devices option!  That is why it was opening the device<br />files.  In my quest to be "nice", I shot myself in the foot.<br /><br />So now the question is why doesn't the shell expand both aliases (I<br />guess it's a safety / can't-tell-what-you-mean issue); is there a way<br />to make the n19
alias expand the command listed after it too; or can I<br />tell the shell to expand aliases after "modifier" commands (nice, xargs,<br />etc).<br /><br />Nice test case (may have to be modified for bash):<br /><br />#alias n19 '/bin/nice -19 /usr/bin/ionice -c2 -n7 -t'<br /><br />#nice n19 echo bobo<br />/bin/nice: n19: No such file or directory<br /><br />#n19 n19 echo bobo<br />ionice: failed to execute n19: No such file or directory<br /><br />In a perfect world the system would "do what I mean" and both above<br />commands would succeed, just as this does:<br /><br />nice nice echo bobo<br /><hr /><br />Roundtable mailing list<br />Roundtable@muug.mb.ca<br /><a href="http://www.muug.mb.ca/mailman/listinfo/roundtable">http://www.muug.mb.ca/mailman/listinfo/roundtable</a><br /></pre></blockquote></div><br>
-- <br>
Sent from my Android device with K-9 Mail. Please excuse my brevity.</body></html>