YesIKnowIT, 7 months ago Right-align text on 80 columns: sed -E ':a /.{80}/!{s/^/ /;ba}' file #Shell #Sed #Linux
Right-align text on 80 columns: sed -E ':a /.{80}/!{s/^/ /;ba}' file
#Shell #Sed #Linux
milosz, 7 months ago @YesIKnowIT Slightly different way is to use column command: column --table --table-right 1 --table-columns-limit 1 --output-width 80 file
@YesIKnowIT Slightly different way is to use column command:
column --table --table-right 1 --table-columns-limit 1 --output-width 80 file
milosz, 7 months ago @YesIKnowIT This was wrong, but as an altenative I have a simpler solution: cat file | while read -r line; do printf "%${COLUMNS}s" "$line"; done
@YesIKnowIT This was wrong, but as an altenative I have a simpler solution: cat file | while read -r line; do printf "%${COLUMNS}s" "$line"; done
Add comment