Skip to content

Instantly share code, notes, and snippets.

@gingerbeardman
Last active Sep 14, 2021
Embed
What would you like to do?
List command line switches and arguments
#!/bin/bash
POSITIONAL=()
while [[ $# -gt 0 ]]; do
key="$1"
value="$2"
shift # past argument
shift # past value
echo "$key $value"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment