source command not found in sh shell

前端 未结 12 739
温柔的废话
温柔的废话 2020-11-28 02:14

I have a script that uses sh shell. I get an error in the line that uses the source command. It seems source is not included in my

12条回答
  •  遥遥无期
    2020-11-28 02:55

    The source builtin is a bashism. Write this simply as . instead.

    e.g.

    . $FILE
    
    # OR you may need to use a relative path (such as in an `npm` script):
    
    . ./$FILE
    

    https://wiki.ubuntu.com/DashAsBinSh#source

提交回复
热议问题