0

The following arguments are valid for docker command:

docker ps -f"status=exited" --format 'table {{.Names}}'
#output:
# jovial_hellman  
# modest_blackwell

So I have created this script

docker-ps-exited

#!/bin/bash
# show exited docker processes
docker ps -f"status=exited" $@

But when I try to add the rest of the arguments in the console it fails:

docker-ps-exited --format 'table {{.Names}}'
# ERROR OUTPUT:
# "docker ps" accepts no arguments.
# See 'docker ps --help'.
# 
# Usage:  docker ps [OPTIONS]

Why the script fails passing the arguments correctly?
How should I write it in order to be able to accept any arguments I pass at the end?

0 Answers0