Enterprise Unix Roundup: Back in the Closet With the Cape Page 2

By Michael Hall (Send Email)
Posted Apr 8, 2004

Main     In Other News     Security Roundup     Tips of the Trade

Security Roundup

  • TurboLinux patched an Apache vulnerability that, harkening back to the days of ANSI bombs, could allow escape sequences in Apache's logs to cause terminals to execute malicious code.

  • Debian and OpenPKG released patches for a bug in tcpdump that could result in a remote DoS attack against it.

  • Debian and OpenPKG also released patches for squid, patching a previously reported bug that could allow some users to bypass the proxy server's access control lists.

Tips of the Trade

We're not ordinarily fond of posting tips that are limited to a single platform, but we are fond of tips that make the command line feel a little closer to our fingertips, even when we're working in a graphical environment. So this week's tip points at the Macintosh text editor BBEdit, which has a feature we'd never explored until we stumbled across it accidentally: shell worksheets. They work like this:

You open a new file using the File->New->Shell Worksheet menu. The first time you do this (and until you remove a file from the BBEdit installation directory), you'll see a lot of text starting with the advisory "YOU ARE NOT RUNNING A TERMINAL EMULATOR." What you are running is a worksheet file. You can type out a shell command (one that returns immediately, such as ls, but not a command like top) and press the Apple and Return keys at the same time. The output of that command appears in the worksheet. The sample worksheet provided with BBEdit offers plenty of other examples to get you started.

So what makes this better than a plain old terminal emulator?

The same things that make a spreadsheet sometimes better than bc: Although there are facilities in the average Unix shell for re-using typed-in commands (such as hitting ctrl-R to search your command history), sometimes it's nice to have your work in a more navigable environment, especially if you're trying to work through a particularly tricky pipe or regexp challenge and could use niceties like bracket matching and syntax highlighting.

If you're interested in entering more than one line (e.g., piping a paragraph worth of text in your worksheet), you can highlight the entire block of text as well as the command to pipe it through; then press Apple-Return.

Bonus tip:

cat somefileaboutsuse.txt |sed s/[Ss][Uu][Ss][Ee]/SUSE/g

What's that? Our heads were spinning from the many ways people are capitalizing "SUSE" these days (probably because it was "SuSE" until shortly before Novell bought the company), so we decided to can a bit of sed that will help us if we slip before our fingers know better.

Remember, regular expressions are your friend.

>> To Main
>> To Other News

Page 2 of 2

Comment and Contribute

Your name/nickname

Your email

(Maximum characters: 1200). You have characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date