tab space issue in script
hi,
output format is getting different one with wrong tab space alignment. even i ve checked with the tab spaces. need solution for the same. [root@server ~]# cat variables #!/bin/bash echo "File Name : $0" echo "First Argument : $1" echo "Second Argument : $2" echo "Quoted Values : $*" echo "Total Number of Arguments : $#" echo "PID of the scipt : $$" echo "PID of last background process : $!" [root@server ~]# sh variables arun akash File Name : variables First Argument : arun Second Argument : akash Quoted Values : arun akash Total Number of Arguments : 2 PID of the scipt : 3802 PID of last background process : [root@server ~]# |
Since posting without using [CODE] ... [/CODE] tags did not preserve your tabs, it's a bit hard to see what you are trying to do. I presume you want those arguments all aligned regardless of the length of the label. Doing that with echo is going to be difficult. Use printf:
Code:
#!/bin/bash |
or "man tabs"
|
If you wanted to do it by hand I would do:
Code:
#!/usr/bin/env bash |
All times are GMT -5. The time now is 04:59 AM. |