Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the Bash operator <<< (i.e. triple less than sign) mean?

Tags:

bash

shell

What does the triple-less-than-sign bash operator, <<<, mean, as inside the following code block?

LINE="7.6.5.4" IFS=. read -a ARRAY <<< "$LINE" echo "$IFS" echo "${ARRAY[@]}" 

Also, why does $IFS remain to be a space, not a period?

like image 572
gsklee Avatar asked Oct 31 '11 05:10

gsklee


People also ask

What does less than sign mean in Bash?

A less-than sign (<) represents input redirection. On the other hand, a greater than sign (>) is used for the output redirection. “<” and “>” are also called angled brackets.

What does >> mean in Bash?

The >> appends to a file or creates the file if it doesn't exist. The > overwrites the file if it exists or creates it if it doesn't exist.

What does >> mean in scripting?

83. > is used to overwrite (“clobber”) a file and >> is used to append to a file. Thus, when you use ps aux > file , the output of ps aux will be written to file and if a file named file was already present, its contents will be overwritten.

What does $# mean in bash script?

$# is the number of positional parameters passed to the script, shell, or shell function. This is because, while a shell function is running, the positional parameters are temporarily replaced with the arguments to the function. This lets functions accept and use their own positional parameters.


1 Answers

It redirects the string to stdin of the command.

Variables assigned directly before the command in this way only take effect for the command process; the shell remains untouched.

like image 65
Ignacio Vazquez-Abrams Avatar answered Oct 13 '22 21:10

Ignacio Vazquez-Abrams