I am a newbie in Unix. My system's OS is Windows and I cannot install Unix on it. Can you please tell me about...
Unix software that works in Windows? I want this because I want to study Unix. Please send me a shell program that takes one or any number of file names as input; sorts the lines of each file in ascending order and displays the non blank lines of each sorted file and merge them as one combined sorted file. The program should generate an error message in case any input file does note exist.
What you are looking for is the MKS Toolkit. What this product gives you is the Unix look and feel on a PC. You have a ton of Unix commands that will work on your Windows environment. It is a mature product that has been around since the early 90s, and I recommend it highly for people who have no access to Unix machines and do not really want to install a Linux partition on their PC.
You may want to rethink your strategy, though, and get acclimated to Linux. Linux, though not Unix, can give you some exposure to Unix-type commands, and the advantage to having your own partition would be running the OS natively, with the advantage of learning a new operating system. It's also free, unlike the toolkit, so the price is right!
As far as the shell script, I'll lead you in the right direction and let you write the actual script, if that's okay. This does not have to be overly complicated.
cat file1 file2 file3 > file4
This will combine the files into a single file. Using the sort command would help you do what you need to do. Do a man-on sort for the different flags. Sort -u file4 (-u to get rid of duplicates), or some other variation should work for you. If you need to do more than simple filtering, do a man-on sed to learn more about what this powerful tool can do for you.
Dig Deeper on Linux servers
Related Q&A from Kenneth Milberg
Learn which makes more sense for your enterprise: building your own cloud-based diagnostic tooling or purchasing an existing product. Expert Ken ... Continue Reading
Learn about Helm Charts and how Kubernetes supports a microservices architecture. Expert Ken Milberg discusses what you need to know before delving ... Continue Reading
As blockchain matures, an ecosystem of tools continues to sprout up around it. Learn how these offerings, including the Hyperledger Fabric Client SDK... Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.