! Binkshhd-abdA $1 | sed-n & amp; 39; 1 p & amp; 39; | cut-c7-70 & gt; $ HOMEtmpFIRSTLINE $ DBFFLAG 'awk & amp; 39; {print $1} & amp; 39; $ HOMEtmpFIRSTLINE $ 'if [$ DBFF
- #! /Bin/ksh
- Hd-abdA $1 | sed-n '1p' | cut-c7-70> $ HOME/tmp/FIRSTLINE $
- DBFFLAG = 'awk' {print $1} '$ HOME/tmp/FIRSTLINE $'
- If [$ DBFFLAG-ne 3]
- Then
- Echo "this is not a database file! Aa"
- Exit 1
- Fi
- DEFSIZE = 'awk' {print ($9 + $10*256)} '$ HOME/tmp/FIRSTLINE $'
- STEP = 'AK' {print ($11 + $12*256)} '$ HOME/tmp/FIRSTLINE $'
- Dd if = $1 of = $ HOME/tmp/DBFEND $ bs = $ DEFSIZE skip = 1 2>/dev/null
- Fold-B-w $ STEP $ HOME/tmp/DBFEND $
- Rm $ HOME/tmp/FIRSTLINE $
- Rm $ HOME/tmp/DBFEND $
- > Echo
Note:"This is not a database file! Aa "," aa ": twice. if it is not a database file, a prompt is displayed! It is easy to use. for example, if the stored name is dbf, Then: $ dbf user. dbf: this is the database file you want to view. if you want to view the content of a dbf file, you can use it like this, in this way, you can generate a file or reference the pipeline to output the command to awk sed. I believe it is still a bit useful.