#!/bin/sh profile="$1" shift if [ -z "$profile" ] ; then cat < [] Executes under AWS credentials for , using aws-vault The defaults to $SHELL --login Equivalent to: aws-vault exec -- EOU exit 2 fi cmd="aws-vault exec --assume-role-ttl=1h --session-ttl=1h $profile -- " if [ -z "$*" ] ; then exec $cmd $SHELL --login else exec $cmd "$@" fi