Sandra Henry-Stocker

  • Redirecting standard error in Perl

    Posted August 14, 2007 - 12:15 pm

    There are numerous ways to redirect standard error in a Perl script. You can redirect the output from one particular command, you can combine standard error with standard out so that the two are handled together or you can send all standard error to the bit bucket. None of these techniques depends on what the person running the script does. Instead, they can all be set up in your Perl scripts. Let's take a look at how this works.
  • Unix Tip: Use your Unix scripting skills to write a batch file

    Posted July 18, 2007 - 9:35 pm

    Attaching a remote drive or directory on a Windows box is called "drive mapping" though the process is essentially the same as what we call mounting in the Unix world. While I rarely spend any significant time working on the Windows end of a Samba connection, I recently had an opportunity to assist a user who was tired of repeatedly having to manually connect directories from a couple of Solaris servers equipped with samba for sharing directories with select Windows desktops. The solution was to whip up a batch file that mapped the drives on login. Batch files, though far less sophisticated than their Unix shell script counterparts, nonetheless have many of the important features that I have become accustomed to working with on my Unix systems. These include such things as redirection, testable return codes, the ability to test for the existence of a file and the equivalent of /dev/null for discarding command output, errors and all.
  • Unix Tip: Clearing the screen

    Posted June 11, 2007 - 4:24 pm

    Often, on encountering this problem, I simply growl, press enter a couple dozen times and continue working. When I'm in a particularly "fixit" mood, on the other hand, I figure I shouldn't be putting up with annoying configuration problems and decide to break my train of thought just long enough to tackle this distracting problem head-on. Here's what you can do when you get an error such as this.

  • Unix Tip: Finding services on a subnet

    Posted May 14, 2007 - 12:23 pm

    If you have ever needed to survey a large group of systems to find out which of them supported some particular service, such as ftp, telnet, ssh or some other particular application, you have probably thought of numerous ways to query the systems for the required information and display it in some usable fashion. Many methods of obtaining information from servers, however, require some sort of login or a remote shell request that either takes more time than you want to spend or requires you to configure some sort of trust on the part of the systems with the information for the system on which it is being collected. In today's column, we will look at a way to find out about services running on systems without setting up any access ahead of time.
  • Unix Tip: Mail loops back to me

    Posted April 3, 2007 - 7:14 pm

    Many systems administrators have run into errors in their syslog files that complain that mail is looping back, suggesting a possible MX problem. The common cause of this problem is that a server is receiving email for a domain that it doesn't recognize as its own. Then, when the server looks up the MX address for the intended target (in order to send the mail on its way), it notices that the MX record is one that identifies the mail exchanger as the system itself.
  • Unix Tip: The perfect crash: Planning after the disaster

    Posted September 6, 2006 - 10:26 am

    Sadly, it is in the aftermath of a big network crash that some of us do our clearest thinking about what we should have done before the disaster struck. We might learn that, even with a powerful UPS, we can find ourselves in a situation in which a sudden loss of power leaves our computer center in the dark, our servers and networking equipment in unknown condition and us with a big problem to solve. How do we get our systems back online with some semblance of control and efficiency when we're not sure what we're starting with?
  • Unix Tip: Sending HTML email

    Posted April 26, 2006 - 12:32 pm

    A common task of sysadmins is to generate email messages and send them out to a group of people. Reminders about upcoming system downtime or tips to help users make better use of their Unix accounts might be sent out routinely. In this week's column, we look at a bare bones script for sending out email in HTML format.
  • How to make DOS look even more like Unix

    Posted August 10, 2005 - 12:45 pm

    One of the other problems that I ran into when trying to make my DOS prompt behave more like my Unix systems was how to invoke my carefully crafted macros every time I opened a new DOS command window. When I put the commands to change my prompt and invoke my macros in a batch file and then ensured that this batch file was on my search path, I could reduce the effort that I had to make to running the batch file every time I opened a command prompt. I've since learned that it is possible to have my batch file invoked automatically whenever I open a DOS window (i.e., run cmd.exe). So, in this week's column, we're going to examine how this can be done.
  • Unix Tip: Changing chown

    Posted September 22, 2004 - 5:19 pm

    If you have tried to give away any files lately on any of your Unix systems (i.e., without first becoming root), you may have been surprised to learn that you can't. On most Unix systems today, any non-root user is likely to get errors such as these when he or she tries to change ownership on a file.
  • Whatcha' gonna make?

    Posted October 18, 2001 - 4:32 pm

    understand make is to look at a programming example.

Join us:






Join today!

See more content
Ask a Question