Working with Unix Tools
نویسنده
چکیده
L ine-oriented textual data streams are the lowest useful common denominator for a lot of data that passes through our hands. We use such streams to represent program source code, Web server log data, version control history, file lists, symbol tables, archive contents, error messages, profiling data, and so on. For many routine, everyday tasks, we might be tempted to process the data using a " Swiss army knife " scripting language such as Perl, Python, or Ruby. However, doing that often requires writing a small, self-contained program and saving it into a file. By that point, we've sometimes lost interest in the task and end up doing the work manually, if at all. Often, it's more effective to combine Unix toolchest programs into a short and sweet pipeline that we can run from our shell's command prompt. With modern shell command-line editing facilities, we can build our command bit by bit, until it molds into exactly the form that suits us. Nowadays, many different systems—including GNU/Linux, Mac OS X, and Microsoft Windows—offer the original Unix tools preinstalled or as free down-loads, so there's no excuse for not adding this approach to your arsenal. Many one-liners that you'll build around the Unix tools follow a pattern that goes roughly like this: data fetching, selection, processing , and summarization. You'll also need to apply some plumbing to these parts. Jump in to get a quick tour of the facilities. Most of the time, your data will be text that you can feed directly to a tool's standard input. If this isn't the case, you'll need to adapt your data. If you're dealing with object files, try a command like nm (Unix), dumpbin (Windows), or javap (Java) to dig into them. If you're working with files grouped into an archive, a command like tar, jar, or ar will list the archive's contents. If your data comes from a (potentially large) collection of files, find can locate those that interest you. Then again, to get your data over the Web, use wget. You can also use dd (and the special file /dev/zero), yes, or jot to generate artificial data, perhaps to run a quick benchmark. Finally, to process a com-piler's list of error messages, redirect its standard error to its standard output; the incanta-tion 2>&1 will do the trick. I've not covered many other cases, including relational databases, version control systems , mail …
منابع مشابه
Command-line utilities for managing and exploring annotated corpora
Users of annotated corpora frequently perform basic operations such as inspecting the available annotations, filtering documents, formatting data, and aggregating basic statistics over a corpus. While these may be easily performed over flat text files with stream-processing UNIX tools, similar tools for structured annotation require custom design. Dawborn and Curran (2014) have developed a decl...
متن کاملPipelining Argumentation Technologies
Software tools for working with argument generally exist as large systems that wrap their entire feature set in the application as a whole. This approach, while perfectly valid, can result in users having to use small parts of multiple systems to carry out a specific task. In this paper, we present a series of web services, that each encapsulate small pieces of functionality for working with ar...
متن کاملApplying Traditional Unix Tools during Maintenance: An Experience Report
The Unix programming environment provides a rich and fairly standard set of generic tools for the development and maintenance of software. In an age of advanced software tools and environments, it is useful to see how new tools compare against an old baseline. Our experiences from one small exercise in maintenance suggest that simple Unix tools seem to raise the bar of excellence deceptively
متن کاملOutwit: UNIX Tool-Based Programming Meets the Windows World
The ubiquity of Windows-based desktop environments has not been matched by a corresponding emergence of tools supporting the Unix tool composition paradigm. Outwit is a suite of tools based on the Unix tool design principles allowing the processing of Windows application data with sophisticated data manipulation pipelines. The outwit tools offer access to the Windows clipboard, the registry, re...
متن کاملWux: UNIX Tools under Windows
Wux is a port of Unix tools to the Microsoft Windows environment. It is based on a library providing a Unixcompatible set of system calls on top of Windows. Unix-derived tools run in parallel, communicating using the Unix pipe abstraction. All processes are run within an application template that gives them basic Windows compatibility such as input and output windows and an icon. The performanc...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- IEEE Software
دوره 22 شماره
صفحات -
تاریخ انتشار 2005