Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Purpose of double angle brackets on the bash command line?

I'm trying to understand the following command:

user$ bash < <(curl -s https://something.com )

What do the < < do?

like image 638
SundayMonday Avatar asked Oct 07 '11 20:10

SundayMonday


People also ask

What is double square brackets in Bash?

2.2. Double Brackets. The double brackets, [[ ]], were introduced in the Korn Shell as an enhancement that makes it easier to use in tests in shell scripts.

What is angle bracket in Bash?

<( Angle Parentheses ) Meaning that you can do things like: diff two streams. run a command within a shell to create an input-"file" for other commands that want input in the form of a file rather than a stream.

What do brackets mean in command line?

The square brackets ( [ ] ) indicate that the enclosed element (parameter, value, or information) is optional. You can choose one or more items or no items. Do not type the square brackets themselves in the command line. Example: [global options], [source language=”arguments”][/source]

What does brackets do in Linux?

Braces are used for function bodies and objects. And brackets are used for lists or array notation. In Bash, that's often a little different and in many cases, parentheses, braces, and brackets act as commands themselves. So it can take a little getting used to if you're coming from other languages.


1 Answers

It's not < < but first < which means input redirection and then <( ... ) which means run the command inside the braces and make from that a file argument.

This looks to me quite equivalent as

curl -s https://something.com | bash
like image 84
jlliagre Avatar answered Nov 15 '22 20:11

jlliagre