Need to assign the contents of a text file to a variable in a bash script

前端 未结 3 1816
离开以前
离开以前 2020-12-15 03:40

I am very new to making bash scripts, but my goal here is to take a .txt file I have and assign the string of words in the txt file to a variable. I have tried this (no clue

3条回答
  •  爱一瞬间的悲伤
    2020-12-15 04:00

    In bash $(< answer.txt) is a builtin shorthand for $(cat answer.txt)

    I suspect you're running this print:

    NAME  
        run-mailcap, see, edit, compose, print − execute programs via entries in the mailcap file
    

提交回复
热议问题