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?
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.
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.
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.
$# 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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With