Escaping double quotes with tcsh alias

后端 未结 5 696
轻奢々
轻奢々 2020-12-11 21:55

I\'m trying to run the following commands:

replace -x \"must \" A2input.txt
replace -x \" a\" -f -s ## A2input.txt
replace -x to -s ## -a A2input.txt
replace         


        
5条回答
  •  旧时难觅i
    2020-12-11 22:24

    If you can't get an alias to work, just write a short shell script, chmod +x, and put it somewhere in your $PATH (like $HOME/bin):

    #!/bin/tcsh
    replace -x "must" ...
    

    I don't have any experience with tcsh, but with bash you do it like any of these:

    alias t='echo "hello  world"'     # using single quotes to enclose entire string
    alias t=echo\ \"hello\ \ world\"  # escape " and 
    alias t="echo \"hello  world\""   # double-quote + escape inner double quotes
    

    Maybe something similar will work in tcsh?

提交回复
热议问题