Skip to content

Instantly share code, notes, and snippets.

@furrz
Created August 4, 2023 16:42
Show Gist options
  • Select an option

  • Save furrz/78e18c12c84c24779971c8c0101bc8fb to your computer and use it in GitHub Desktop.

Select an option

Save furrz/78e18c12c84c24779971c8c0101bc8fb to your computer and use it in GitHub Desktop.
cobold.sh - do the funny to your COBOL source files
#!/bin/sh
# cobold.sh - squeeze anything into the sequence number columns of a COBOL source file.
# usage: cobold.sh [source.cob] [some_text.txt]
# output *should* be syntactically correct
cut -b 7- "$1" > "$1_tmp"
fold -w 6 "$2" > "$2_tmp"
paste -d '\0' "$2_tmp" "$1_tmp"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment