I have one-line that I want to call using alias.while printf '%s ' $(df -P / | awk 'NR==2 { print $(NF-1) }'); do sleep 30; doneI tried to escape ' like \' but it didn't work.What is the correct syntax to use above one-liner in alias?
How to use ' in alias?
shell script;quoting;alias;escape characters
alias my_du=$'while printf \'%s \' $(df -P / | awk \'NR==2 { print $(NF-1) }\'); do sleep 3; done'You can check the result withalias my_duIf $() is quoted by  instead of ' or \ then it is substituted and the result rather than the intended program call becomes part of the alias definition.