I'm trying to truncate a part of the file name of my present working directory. This is the code I am using:
set test = "$cwd" | awk -F "/" '{print $3}'
set USER_CUST = ${test:s/abc_//}
(Explanantion: I want to cut out the "abc_" part from the third folder from the root)
When I run the script(script_check.csh) I am getting this in my console :
tcsh -x script_check.csh
set test = /proj/proj_name/abc_username/folder/sub_folder
awk -F / {print $3}
test: Undefined variable.
Why is test an undefined variable? Is there another possible workaround?