由买买提看人间百态

topics

全部话题 - 话题: urfile
(共0页)
h******a
发帖数: 198
1
来自主题: Unix版 - Print out Line Number using lp ???
1st qestion:
awk '{print NR,$0}' urfile > newfile
or awk '{printf("%-5d%s\n",NR,$0)}' urfile >newfile (better looking)
or grep -n "" urfile > newfile
2 question:
when you print file, you could setup print configuration.
h******a
发帖数: 198
2
来自主题: Unix版 - how to let awk not print?
awk '!/^$/' urfile
perl -pi -e 's/^$//g' urfile
sed -ne '/^$/!p' urfile
if using tcsh/csh, be careful of using !
B**z
发帖数: 153
3
来自主题: Unix版 - Print out Line Number using lp ???
1)
easier way
nl urfile |lp
(共0页)