I would like to use the command line to copy the file names and put them into a text file. They may be more with other names but as an example. List of files:
iw1-201506.SAFE.safe iw2-201507.SAFE.safe iw1-201506.xml iw2-201507.xml File names add to the following text. The end result is needed:
awk 'NR>1 {print $0}' < ../orig/iw1-201506.SAFE.safe > tmp_file cat ../orig/iw1-201506.xml tmp_file ../orig/m.xml > ./iw1-201506.xml awk 'NR>1 {print $0}' < ../orig/iw2-201507.SAFE.safe > tmp_file cat ../orig/iw2-201507.xml tmp_file ../orig/m.xml > ./iw2-201507.xml #и так далее How could I implement this? Maybe you can mark the row and column in which the echo command will insert the word?
Also I will be very grateful for the link to a good manual on this topic.
My clumsy example but it is not fully implemented because I do not know how to designate two different formats and therefore adds only one line. It immediately copies the file names and inserts it with the text below into the file, since there can be a lot of files.
for a in $(cd any/directory; ls *xml) do echo "cat ../orig/$a tmp_file ../orig/m.xml > ./$a" >> data.txt done
find any/directory -type f -name "*.xml" -o -name "*.safe" -print0 | xargs -0find any/directory -type f -name "*.xml" -o -name "*.safe" -print0 | xargs -0. 2.man readlink; man realpathman readlink; man realpath. 3. File extension from nameecho ${fname#*.}. - 0andriy