I would like to pass to a given Ruby script, a file as parameter. This file contains just a number (ID).
The command to run the Ruby scripts looks something like:
test export 123456 -o ./path/to/export -x
The number 123456
rappresents the parameter that i want to pass via txt/dat file from GitLab.
I tried:
test export "$(< /home/file.dat)" -o ./path/to/export -x
And also:
test export "`cat file.dat`" -o ./path/to/export -x
But i always get the same error:
cat: file.dat: No such file or directory
The very interesting point is that if i run cat
before the other command, the content of the file is there (so the file is found). If i run it "nested" inside the Ruby command, it won't be found.
Any ideas how can i solve this?
Thank you very much