How-To Geek on MSN
Why printf is superior to echo in Linux scripts
The printf command offers well-defined behavior following the POSIX standard, which means it works the same way across shells and systems. Where echo often fails with escape sequences, printf handles ...
A recent post about debugging constructs surprised me. There were quite a few comments about how you didn’t need a debugger, as long as you had printf. For that matter, we’ve all debugged systems ...
Imagine that you want to output multiple lines of text in Bash, or any shell script. Maybe it’s for a help string for a particularly convoluted shell script you’re writing. You could have a separate ...
I realize I've been playing a bit fast and loose with my shell scripts over the last few months, because I haven't talked about how to ensure that error conditions ...
Some of the most versatile commands you can run on the Linux command line are those that enable you to pass the output of one command to another by using something called a “pipe”. You can also set up ...
The script command not only makes a record of what commands you run but also allows you to save the output generated so that you can examine it later or easily turn your command sequences into scripts ...
Results that may be inaccessible to you are currently showing.
Hide inaccessible results