Here's the script I am executing:
#!/bin/bash ... function myprint() { cp=$1 targetpermission=$2 t1="RESOURCE" t2="Current Permission" t3="New Permission" printf "%s : %s ===> %s\n",$t1,$t2,$t3 } myprint Expected output:
RESOURCE : Current Permission ===> New Permission Output I am getting:
[abhyas_app01@localhost safeshell]$ ./test1.sh Permission,New : Permission ===> ,RESOURCE,Current[abhyas_app01@localhost safeshell]$ Just what's going on? How do I get the expected output?
PS - echo is not an option, because eventually I am going to justify the strings using %-Ns where N is a calculated based on terminal width.
printfwithout commas, i.e.,printf "%s : %s ===> %s\n" $t1 $t2 $t3