1

I wanted to apply an answer about non interactive postfix installation on debian distros. But I don't get the meaning of the <<< operator found in it, that's the first time I see it :

debconf-set-selections <<< "postfix postfix/mailname string your.hostname.com"

What's its purpose?

When I try it I get a /bin/sh: 1: Syntax error: redirection unexpected error.

vmonteco
  • 14,136
  • 15
  • 55
  • 86

1 Answers1

1

It's a here-string, not all shells use this syntax, but at least , ,

Check :

man bash | less +/'Here Strings' 

:

A variant of here documents, the format is:

[n]<<

The word undergoes brace expansion, tilde expansion, parameter and variable expansion, command substitution, arithmetic expansion, and quote removal. Pathname expansion and word splitting are not performed. The result is supplied as a single string, with a newline appended, to the command on its standard input (or file descriptor n if n is specified).

It's like a here-doc but instead of lines, we have just a string

Your error means that you are using the posix shell , and here-string is not supported.

To fix this, use or use a pipe like this :

echo 'string' | command
Gilles Quénot
  • 173,512
  • 41
  • 224
  • 223