Operating System - HP-UX
1836759 Members
2671 Online
110109 Solutions
New Discussion

Setting up an alias containing single and double quotes

 
SOLVED
Go to solution
Mr Peter Kempner
Occasional Contributor

Setting up an alias containing single and double quotes

I am trying without success to alias the following command:

ll -t * |awk {'printf "%-4s%-3s%-10s%s\n", $6, $7, $8, $9'}|head

I have tried everything I can think of to cope with the quotes in the command but to no avail. Surely there is a way ....
2 REPLIES 2
Robin Wakefield
Honored Contributor
Solution

Re: Setting up an alias containing single and double quotes

alias lt='ll -t * |awk "{printf \"%-4s%-3s%-10s%s\n\", \$6, \$7, \$8, \$9}"|head'

should work.

Robin
federico_3
Honored Contributor

Re: Setting up an alias containing single and double quotes

try like thi":
alias llt="ll -t * | awk '{printf \"%-4s%-3s%-10s%s\n\", \$6,\$7,\$8,\$9}'| head "