I am trying to find the file names in a path. Using following script, but getting issue when tries to put that name in a variable:
for file in "${PROJECT_DIR}/temp_namespaces"/*
do
echo "${file##*/}"
namespaces= "${file##*/}"
echo "namespace = " > "${namespaces}"
done
it prints the file name from first echo, but after that both lines gives error:
namespaces= "${file##*/}" ---- command not found
echo "namespace = " > "${namespaces}" ---- No such file or directory
I am using linux available on amazon/aws-cli base image to run the above script.
I need to get the file names from a path and store them in a variable that will be used later in script to run few more commands.
Any pointers are appreciated.
Thanks