Nп/п : 82 из 85
От : Grant Weasner 1:138/397 19 май 25 01:24:03
К : All 19 май 25 11:31:01
Тема : text reformating
----------------------------------------------------------------------------------
@MSGID: 269.fidonet_linux@1:138/397 2c9021b0
@TZUTC: -0700
@PID: Synchronet 3.20a-Linux master/57c2367a5 Sep 18
202 GCC 10.2.1
@TID: SBBSecho 3.20-Linux master/57c2367a5 Sep 18
2024 22:26 GCC 10.2.1
@COLS: 132
@BBSID: LUNAROUT
@CHRS: ASCII 1
@NOTE: FSEditor.js v1.105
Hello all.
I`m wondering what others think about linux a text formating task
I`m trying to solve.
I`ve got lots of older howtos from the old web, and stuff I`ve also wrote.
I want to convert all of my text files in many directories into a
gopher fiendly format.
Gopher friendly:
1) 64 columns wide.
2) any indents will remain, but if a line goes beyond 64 cols,
the remaining characters will go to the line below but indent to the
same column as the prior line.
This seems pretty difficult and I`m wondering how others would
approch this task.
I`m thinking of just writing a python script using basic python modules.
But I`m wondering if there are just native linux tools that would
work as good or better.
EXAMPLE TEXT BELOW
-------------------------------------------------------
$ ssh skinner "dd if=/dev/sda5 | gzip -1 -" | dd of=image.gz
208782+0 records in
208782+0 records out
106896384 bytes (107 MB) copied, 22.7608 seconds, 4.7 MB/s
116749+1 records in
116749+1 records out
59775805 bytes (60 MB) copied, 23.9154 s, 2.5 MB/s
$ ll | grep image.gz
-rw-rw-r--. 1 saml saml 59775805 May 31 01:03 image.gz
Methods for monitoring?
1 1. Login via ssh in another terminal and ls -l the file to see
what it`s size is.
2 2. You can use pv to monitor the progress of a large dd
operation, for instance, for the remote example above, you can do:
$ dd if=/dev/sda | gzip -1 - | pv | ssh user@local dd of=image.gz
3 3. Send a "SIGUSR1" signal to dd and it will print stats. Something like:
$ pkill -USR1 dd
--- SBBSecho 3.20-Linux
* Origin: Lunar Outpost - lunarout.synchro.net (1:138/397)
SEEN-BY: 1/120 18/0 50/109 103/705 104/119 114/10
116/116 120/616 123/0 25
SEEN-BY: 123/126 180 525 755 3001 3002 124/5016
135/115 138/142 146 397
SEEN-BY: 153/757 7001 7715 154/10 30 50 700 203/0
220/6 20 30 90 221/0 6
SEEN-BY: 222/2 226/18 44 50 229/310 426 240/1120
5832 250/1 263/1 275/100
SEEN-BY: 275/1000 280/464 5003 292/854 8125 301/1
310/31 341/66 234 342/11
SEEN-BY: 396/45 423/120 460/58 463/68 467/888
633/280 712/848 1321 1321 770/1
SEEN-BY: 2320/105 3634/0 12 27 56 57 58 60 119
5000/111 5020/400 545 715 828
SEEN-BY: 5020/830 846 848 1042 4441 12000 5030/49
1081 1474 1900 5060/900
SEEN-BY: 5061/133 5075/128 5083/444 6078/80
@PATH: 138/397 153/7715 3634/12 154/10 280/464
467/888 5020/1042 4441