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...
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
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
Need a PaaS platform with strong production support? Explore production support and SLAs of AWS Elastic Beanstalk, IBM Bluemix, Google App Engine and...continue reading
When you move to PaaS for your web-based apps, remember to think about database services. Consider the benefits of moving your database to a fully ...continue reading
Making sure that your PaaS offering and the web development framework of your choice agree can be tricky. Learn how to choose the best framework for ...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.