Hi there to the community,
i have a bash script with an awk command inside, the awk program is in a separate file cause it's a bit big.
Inside the awk program i calculate a filename from some data and i want to create a new file with this name into a directory whose path is passed in awk.
Etc. lets say that the awk command in the script looks like this :
awk -v target=$dir1/$dir2 -f inputfile
what i need to do is create (inside the awk program) a file called 'filename' under the target.
I 've been trying to do this with touch(), i know that system commands do not work in awk so i had to call touch() through system() to get it done.
So i am using
system ("touch "target/filename)
, but it doesn't work. Not that is generates an error, it simply does nothing.
If i write
system ("touch "filename)
the file is being created but the thing is that i want to create it in the directory pointed by target.
Any help?
which should create a file with the name that equals the value of the variable "filename", in the directory with the name that equals the value of the variable "target".