9 lines
357 B
Bash
9 lines
357 B
Bash
#!/bin/sh
|
|||
|
|
# A small shell script (using POSIX AWK) to convert pdpnasm .po files into ILDEC .oct files
|
||
|
|
# Usage: po2oct.sh input.po output.oct
|
||
|
|
# Created by Luxferre in 2026, released into the public domain
|
||
|
|
|
||
|
|
for l in $(cat "$1"); do
|
||
|
|
printf '%d\n' "0$l"
|
||
|
|
done | awk 'BEGIN{a=0}/[0-9]+/{if($1>4096)a=$1%4096;else{if($1)printf("%04o: %04o\n",a,$1);a++}}' > "$2"
|