I'm on HP Unix and in a Job, I tried to extract all files from a folder, and replace the extension (.xxxx) by '*' , remove duplicates and move the result in a file..
Example :
Folder has : ABC, CCC.txt, CCC.sf, CCC.sfd, DDD
I need to generate and output file with :
ABC*
CCC*
DDD*
the commands that I did (See below) is working, but it increased the size of the logs because in my folder it has more than 600 000 files.. Is I can used another command to doing it or do an echo off somewhere and echo on after the execution.. thanks
To keep the forums high quality for all users, please take the time to format your posts correctly.
First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags
```text
and
```
by hand.)
Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.
Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.
My previous post missed the replacement * in sed 's/[.][^.]*$/*/' .
But still this is different from the original while loop: it does not add the * when there is no .xxxx extension.
BTW your last post has ICODE tags instead of Code tags. The latter work much better for multi-line code blocks.