bash trick - prefixing a command?

Dr. Michael J. Chudobiak mjc at avtechpulse.com
Tue Oct 25 17:17:28 UTC 2005


Terry Polzin wrote:
>> I want to do some shell trickery so that when a user enters a command like:
>>
>> ls -l
>>
>> the command is forwarded to another program as an argument. That is,
>> what actually gets executed is:
>>
>> myprog "ls -l"
>>
> I think what yo want to do would be a command alias.  Generally, these are  
> setup in either the /etc/profile or in the individual users .bash_profile 


No, I don't think an alias would work - the argument isn't known ahead 
of time, so you can't define an alias.


- Mike





More information about the fedora-list mailing list