1

I am a beginner with bash scripts and my bash script begins with reading a file's one line content into a variable, however it returns the error

pid: not found

My script looks like:

pid = `cat /home/file.py`
echo $pid

I also tried

pid = $(</home/file.py)

and got the same error.

Jahid
  • 19,822
  • 8
  • 86
  • 102
Thomas Britton
  • 113
  • 2
  • 8

1 Answers1

1

In pid = $(</home/file.py), = and $(</home/file.py) is arguments for a command pid. It doesn't specify an assignment. For assignment you need to do:

var=something #without any space in-between
Jahid
  • 19,822
  • 8
  • 86
  • 102