Using an alias in find -exec

前端 未结 7 678
醉酒成梦
醉酒成梦 2021-01-07 19:11

I have a very long command in bash, which I do not want to type all the time, so I put an alias in my .profile

alias foo=\'...\'

Now I want

相关标签:
7条回答
  • 2021-01-07 20:12

    I am using the ll commonly know alias for this example but you may use your alias instead, just replace ll in the following line with your alias (foo) and it should work:

    find . -exec `alias ll | cut -d"'" -f2` {} \;
    

    your case:

    find . -exec `alias foo | cut -d"'" -f2` {} \;
    

    Note it assumes your alias is quoted using the following syntax:

    alias foo='your-very-long-command'
    
    0 讨论(0)
提交回复
热议问题