You can use aliases only for commands, not for their arguments.
If you want /home/file
to be replaced by /home/thisfile
, but only if it's the first argument of the cat
command, you can define a cat
function that tests its argument and calls the underlying command appropriately:
cat () {
if [ "$1" = "/home/file" ]; then shift; set "/home/thisfile" "$@"; fi
command cat "$@"
}
But I doubt that's what you really want, it would be a strange requirement. Daniel Beck's suggestion of a symbolic sounds right. Since you reject it, you should explain more of what you're trying to accomplish. Maybe then people can offer better suggestions.