I am trying to set the name of a file to a variable with a shell script. I've searched online and found this post, but it is not helping me achieve what I'd like to do which is the following:
JSFILE=ls build/static/js/ | head -1
CSSFILE=ls build/static/css/ | head -1
With, ls ${path} | head -1
I am able to print out the file I want to set a variable to but I keep seeing the following error/output when I try to set the name of the file I want to a variable:
deploy.sh: line 1: build/static/js/: is a directory
Does anyone know how to print out the name of a file to set it to variable in bash?