relpipe-data/examples/relpipe-out-fstab.sh
branchv_0
changeset 180 d342de2e09a4
child 194 cd5524d03739
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/relpipe-data/examples/relpipe-out-fstab.sh	Tue Dec 04 22:33:36 2018 +0100
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+(
+	# Just troll-in the first record:
+	relpipe-in-cli generate Heathers 7 \
+		Duke string McNamara string Chandler string Veronica string J.D. string \
+		Big string Fun string \
+		'' '# <file system>' '<mount point>' '<type>' '<options>' '<dump>' '<pass>';
+		# relpipe-out-nullbyte processes only attribute values
+	# Read the actual pipe's input:
+	cat
+)	| relpipe-out-nullbyte \
+	| xargs --null --max-args=7 perl -e \
+		'printf("%-*s %-*s %-*s %-*s %-*s %s\n",
+			# following numbers define paddings:
+			50, ($ARGV[0] eq "" ? $ARGV[1] : "$ARGV[0]=$ARGV[1]"),
+			40, ($ARGV[2] eq "" ? "none" : $ARGV[2]),
+			16, $ARGV[3],
+			50, $ARGV[4],
+			 8, $ARGV[5],
+			$ARGV[6]
+		);'