Skip to main content
deleted 1 character in body
Source Link
Admineral
  • 401
  • 2
  • 8

I use Bash

I wrote a command for printing only docker id separate with whitespaces on one line.

docker ps -a | grep -E '^[a-z0-9]{12}' -o | awk '{printf "%s ",$0} END {print ""}'

Works well, so I decided to make it an alias.

First, it seems that the whitespace here "%s " was a problem, so I decided to escape it

The new command looks like this:

docker ps -a | grep -E '^[a-z0-9]{12}' -o | awk '{printf "%s\ ",$0} END {print""}'

Now, no errors when sourcing the .bashrc but when I tried to run my alias I get the following error:

{printf %s ,-bash} END {print}
        ^ syntax error

I already looked at this fish: whitespace in alias but I am not using fish

EDIT, my alias looks like this:

alias dockerid="docker ps -a | grep -E '^[a-z0-9]{12}' -o | awk '{printf "%s\ ",$0} END {print""}'"

Note that if I useduse single quote, the source command fails

I use Bash

I wrote a command for printing only docker id separate with whitespaces on one line.

docker ps -a | grep -E '^[a-z0-9]{12}' -o | awk '{printf "%s ",$0} END {print ""}'

Works well, so I decided to make it an alias.

First, it seems that the whitespace here "%s " was a problem, so I decided to escape it

The new command looks like this:

docker ps -a | grep -E '^[a-z0-9]{12}' -o | awk '{printf "%s\ ",$0} END {print""}'

Now, no errors when sourcing the .bashrc but when I tried to run my alias I get the following error:

{printf %s ,-bash} END {print}
        ^ syntax error

I already looked at this fish: whitespace in alias but I am not using fish

EDIT, my alias looks like this:

alias dockerid="docker ps -a | grep -E '^[a-z0-9]{12}' -o | awk '{printf "%s\ ",$0} END {print""}'"

Note that if I used single quote, the source command fails

I use Bash

I wrote a command for printing only docker id separate with whitespaces on one line.

docker ps -a | grep -E '^[a-z0-9]{12}' -o | awk '{printf "%s ",$0} END {print ""}'

Works well, so I decided to make it an alias.

First, it seems that the whitespace here "%s " was a problem, so I decided to escape it

The new command looks like this:

docker ps -a | grep -E '^[a-z0-9]{12}' -o | awk '{printf "%s\ ",$0} END {print""}'

Now, no errors when sourcing the .bashrc but when I tried to run my alias I get the following error:

{printf %s ,-bash} END {print}
        ^ syntax error

I already looked at this fish: whitespace in alias but I am not using fish

EDIT, my alias looks like this:

alias dockerid="docker ps -a | grep -E '^[a-z0-9]{12}' -o | awk '{printf "%s\ ",$0} END {print""}'"

Note that if I use single quote, the source command fails

added 202 characters in body
Source Link
Admineral
  • 401
  • 2
  • 8

I use Bash

I wrote a command for printing only docker id separate with whitespaces on one line.

docker ps -a | grep -E '^[a-z0-9]{12}' -o | awk '{printf "%s ",$0} END {print ""}'

Works well, so I decided to make it an alias.

First, it seems that the whitespace here "%s " was a problem, so I decided to escape it

The new command looks like this:

docker ps -a | grep -E '^[a-z0-9]{12}' -o | awk '{printf "%s\ ",$0} END {print""}'

Now, no errors when sourcing the .bashrc but when I tried to run my alias I get the following error:

{printf %s ,-bash} END {print}
        ^ syntax error

I already looked at this fish: whitespace in alias but I am not using fish

EDIT, my alias looks like this:

alias dockerid="docker ps -a | grep -E '^[a-z0-9]{12}' -o | awk '{printf "%s\ ",$0} END {print""}'"

Note that if I used single quote, the source command fails

I use Bash

I wrote a command for printing only docker id separate with whitespaces on one line.

docker ps -a | grep -E '^[a-z0-9]{12}' -o | awk '{printf "%s ",$0} END {print ""}'

Works well, so I decided to make it an alias.

First, it seems that the whitespace here "%s " was a problem, so I decided to escape it

The new command looks like this:

docker ps -a | grep -E '^[a-z0-9]{12}' -o | awk '{printf "%s\ ",$0} END {print""}'

Now, no errors when sourcing the .bashrc but when I tried to run my alias I get the following error:

{printf %s ,-bash} END {print}
        ^ syntax error

I already looked at this fish: whitespace in alias but I am not using fish

I use Bash

I wrote a command for printing only docker id separate with whitespaces on one line.

docker ps -a | grep -E '^[a-z0-9]{12}' -o | awk '{printf "%s ",$0} END {print ""}'

Works well, so I decided to make it an alias.

First, it seems that the whitespace here "%s " was a problem, so I decided to escape it

The new command looks like this:

docker ps -a | grep -E '^[a-z0-9]{12}' -o | awk '{printf "%s\ ",$0} END {print""}'

Now, no errors when sourcing the .bashrc but when I tried to run my alias I get the following error:

{printf %s ,-bash} END {print}
        ^ syntax error

I already looked at this fish: whitespace in alias but I am not using fish

EDIT, my alias looks like this:

alias dockerid="docker ps -a | grep -E '^[a-z0-9]{12}' -o | awk '{printf "%s\ ",$0} END {print""}'"

Note that if I used single quote, the source command fails

added 25 characters in body
Source Link
Admineral
  • 401
  • 2
  • 8

I use Bash

I wrote a command for printing only docker id separate with whitespaces on one line.

docker ps -a | grep -E '^[a-z0-9]{12}' -o | awk '{printf "%s ",$0} END {print ""}'

Works well, so I decided to make it an alias.

First, it seems that the whitespace here "%s " was a problem, so I decided to escape it

The new command looks like this:

docker ps -a | grep -E '^[a-z0-9]{12}' -o | awk '{printf "%s\ ",$0} END {print""}'

Now, no errors, when sourcing the .bashrc but when I tried to run my alias I get the following error:

{printf %s ,-bash} END {print}
        ^ syntax error

I already looked at this fish: whitespace in alias but I am not using fish

I use Bash

I wrote a command for printing only docker id separate with whitespaces on one line.

docker ps -a | grep -E '^[a-z0-9]{12}' -o | awk '{printf "%s ",$0} END {print ""}'

Works well, so I decided to make it an alias.

First, it seems that the whitespace here "%s " was a problem, so I decided to escape it

The new command looks like this:

docker ps -a | grep -E '^[a-z0-9]{12}' -o | awk '{printf "%s\ ",$0} END {print""}'

Now, no errors, but when I tried to run my alias I get the following error:

{printf %s ,-bash} END {print}
        ^ syntax error

I already looked at this fish: whitespace in alias but I am not using fish

I use Bash

I wrote a command for printing only docker id separate with whitespaces on one line.

docker ps -a | grep -E '^[a-z0-9]{12}' -o | awk '{printf "%s ",$0} END {print ""}'

Works well, so I decided to make it an alias.

First, it seems that the whitespace here "%s " was a problem, so I decided to escape it

The new command looks like this:

docker ps -a | grep -E '^[a-z0-9]{12}' -o | awk '{printf "%s\ ",$0} END {print""}'

Now, no errors when sourcing the .bashrc but when I tried to run my alias I get the following error:

{printf %s ,-bash} END {print}
        ^ syntax error

I already looked at this fish: whitespace in alias but I am not using fish

deleted 5 characters in body
Source Link
Admineral
  • 401
  • 2
  • 8
Loading
Source Link
Admineral
  • 401
  • 2
  • 8
Loading