8

Searching open source projects, shows me that spec files in the wild do use bash constructs, for instance cat info|while read.

But is it really safe? Does the rpm documentation tells me I can count on the %build section being run by Bash?

Elazar Leibovich
  • 32,750
  • 33
  • 122
  • 169

2 Answers2

7

The default shell invoked for each of the spec stanzas is given by %_buildshell. This defaults to /bin/sh, but can be overridden either globally or on a per-stanza basis.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
1

Short answer: yes

Long answer: While bash has become the de facto standard of Linux shells and in practice you can count on having bash around, it does not hurt to specify %_buildshell to /bin/bash as already mentioned in @Ignacio Vazquez-Abrams 's answer

Kimvais
  • 38,306
  • 16
  • 108
  • 142