Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

Bash and shell utils 20 bytes##bytes

compgen -b|head -1ドル

You can save that in a file with execute permissions (builtins) and run it under bash like this:

$ ./builtins 5
 .
 : 
 [
 alias 
 bg 

Outputs the first N bash built ins.

If you are running some shell other than bash, you will need the shebang #!/bin/bash line at the start of the file, for +12b

Bash and shell utils 20 bytes##

compgen -b|head -1ドル

You can save that in a file with execute permissions (builtins) and run it under bash like this:

$ ./builtins 5
 .
 : 
 [
 alias 
 bg 

Outputs the first N bash built ins.

If you are running some shell other than bash, you will need the shebang #!/bin/bash line at the start of the file, for +12b

Bash and shell utils 20 bytes

compgen -b|head -1ドル

You can save that in a file with execute permissions (builtins) and run it under bash like this:

$ ./builtins 5
 .
 : 
 [
 alias 
 bg 

Outputs the first N bash built ins.

If you are running some shell other than bash, you will need the shebang #!/bin/bash line at the start of the file, for +12b

compgen -b is shorter than help | grep ...
Source Link

Bash and shell utils 3420 bytes##

help|grep -o "^compgen [a-z]* "|headb|head -1ドル

You can save that in a file with execute permissions (builtins) and run it under bash like this:

$ ./builtins 5
 alias .
 bg: 
 bind [
 breakalias 
 builtinbg  

Outputs the first N bash built ins, works properly for N of 1-27.

If you are running some shell other than bash, you will need the shebang #!/bin/bash line at the start of the file, for +12b

Bash and shell utils 34 bytes##

help|grep -o "^ [a-z]* "|head -1ドル

You can save that in a file with execute permissions (builtins) and run it under bash like this:

$ ./builtins 5
 alias 
 bg 
 bind 
 break 
 builtin 

Outputs the first N bash built ins, works properly for N of 1-27.

If you are running some shell other than bash, you will need the shebang #!/bin/bash line at the start of the file, for +12b

Bash and shell utils 20 bytes##

compgen -b|head -1ドル

You can save that in a file with execute permissions (builtins) and run it under bash like this:

$ ./builtins 5
 .
 : 
 [
 alias 
 bg  

Outputs the first N bash built ins.

If you are running some shell other than bash, you will need the shebang #!/bin/bash line at the start of the file, for +12b

Source Link

Bash and shell utils 34 bytes##

help|grep -o "^ [a-z]* "|head -1ドル

You can save that in a file with execute permissions (builtins) and run it under bash like this:

$ ./builtins 5
 alias 
 bg 
 bind 
 break 
 builtin 

Outputs the first N bash built ins, works properly for N of 1-27.

If you are running some shell other than bash, you will need the shebang #!/bin/bash line at the start of the file, for +12b

AltStyle によって変換されたページ (->オリジナル) /