Skip to content

A snippet of FOGProject awk code used to resize partitions from sfdisk -d data being reworked.

Notifications You must be signed in to change notification settings

cspenceiv/sfdisk-awk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sfdisk-awk

Introduction

This is a snippet of code used in the FOGProject to resize partitions from sfdisk -d data. This repository exists with the purpose of experimenting, testing, and ultimately separating the awk code from bash.

Why do this? Mixing awk and bash at this scale is difficult to read and understand. Just look at bash-test.sh. It is not in a friendly format, contains excessive newline slashes, and does not feature comments.

Testing Notes

The file bash-test.sh is a snippet of code that represents the original form of the awk script.

The file procsfdisk.awk is the work in progress for reworking bash-test.sh as a seperate script that is purely awk.

An example.data file can be generated by running sfdisk -d example.data on a linux host.

One of the example test comparisons follows:

./bash-test.sh example.data resize /dev/sda1 100000

./procsfdisk.awk -v p0=resize -v p1=/dev/sda1 -v p2=100000 example.data

About

A snippet of FOGProject awk code used to resize partitions from sfdisk -d data being reworked.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published