How to change file names in Shell Script?
Solution 1:
A few things to note:
-
the syntax for command substitution is
$( command )
not($ command )
-
the syntax for printing the second field in awk is
print $2
notprint=$2
-
you need to pass the name of the file as an argument to awk ex.
awk 'NR==1 {print $2}' "$f"
Also note that the new file will be created relative to the current directory, rather than the subdirectory sequences
(there's not enough detail in your question to know whether that's the intended outcome or not).