![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Sed question
echo "SOME" | sed -e :a -e "s/^.\{1,$COUNT\}$/ &/;ta"
Could someone please, tell me how does this script work? Also, what is ":a" and what for what it's needed? |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Is this command part of a script? If yes, could you post the entire script else what is $COUNT?
:a - defines a label 'a' and ta - branches to (like goto) to label 'a' if the substitution is successful I understand that this sed is trying to right justify the text to $count characters(provided the line length is less than $count character). Last edited by quintet; 01-23-2008 at 07:52 AM. |
|||
| Google The UNIX and Linux Forums |