I have this lines that I will insert in a mail called header.header=-------------------------------------Name\tAge\tGender\tAddress-------------------------------------Unfortunately, the \t does not work as I expected it to be. I even tried to put the \t between these two ``.Then I put this $header in the auto-email.mailx -s $subject -r $from $to <<-eof$header$body$footereof}
tabs in variable not working
shell script;scripting;ksh;aix
Use the \n to add newlines to your header:header=-------------------------------------\nName\tAge\tGender\tAddress\n-------------------------------------\nThen use for instance echo -e $header to display:echo -e $header-------------------------------------Name    Age Gender  Address-------------------------------------If echo -e does not work, use printf instead. If your output starts with dashes call printf -- $header to tell printf to interpret the complete variable as output instead of trying to parse them as arguments.After more testing the original variable also works with printf:header=-------------------------------------Name\tAge\tGender\tAddress-------------------------------------printf -- $header-------------------------------------Name    Age     Gender  Address-------------------------------------To use this in mailx you can use:mailx -s $subject -r $from $to <<eof$header$body$footereof