I have a simple bash script that I want to take a line from a file whilst in a loop and add it as an argument in an iterative process.
The problem is that when I pass in foo
it is not being processed and the script still shows $1
.
Script:
#/bin/bash
echo 'var FileWriter = Java.type("java.io.FileWriter");
var fw=new FileWriter("./test.txt", true);
fw.write("\n$1");
fw.close();'
Command and output:
writefile.sh foo
➜ Development bash test.sh foo
var FileWriter = Java.type("java.io.FileWriter");
var fw=new FileWriter("./test.txt", true);
fw.write("\n$1");
fw.close();
I would expect that Bash would pick up the $1
and associate it with the argument passed in. What is missing here?