Hi,
I was a typical Windows guy. Like to do things just by clicking my mouse
. I got a new job now...where they are big on unix.
I am trying to wet my fingures now with unix. Haven't taken the dive yet.
I am trying to find a solution for this problem.
Please help me with some ideas.
Now the problem:
For ex: I have 6 files.
input_1.txt
input_2.txt
input_3.txt
input_4.txt
input_5.txt
input_6.txt
I want to write a script to concat the files on the parameter I pass to the script. Say If I pass parameter 2 to the script.
It should do this....
cat input_1.txt input_2.txt input_3.txt > input_1.txt
cat input_4.txt input_5.txt input_6.txt > input_2.txt
So, If I pass 3 to the script.
It should do this....
cat input_1.txt input_2.txt > input_1.txt
cat input_3.txt input_4.txt > input_2.txt
cat input_5.txt input_6.txt > input_3.txt
And the initial files I have can be dynamic....one day...I may have 20 or 30 files. Could be 25 (odd) too. The script should be dynamic enough.
I hope...my problem is clear enough for you.
Thanks for all your time.
-Sandeep