The Archives

  • 22.Jan.10
    Vim for programmers (III) shell | fernape | (0)
    Welcome to the last "Vim for programmers" issue. Ironically, in this issue I will show you some nice characteristics despite they are not specific of programming. However they make much more sense when they are applied to programming. Getting C help This first feature is oriented directly to C programming. In most UNIX systems, there is a collection of system manual pages available with the command "man". Although I will not explain man in detail (you can read more here (or type man man) it is worth saying it shows information about the command, system call, file, etc passed as parameter. ...
  • 12.May.09
    Quick access to the ASCII table cmd | rafacas | (0)
    man ascii Prints octal, hexadecimal and decimal listings of the ASCII character set.
  • 06.Dec.08
    apropos cmd | pfortuny | (0)
    $ apropos intro Lists man pages related to 'intro'.
  • 02.Dec.08
    Quiet grep automated, shell | pfortuny | (0)
    Usually during an cron job, one needs to check for an expression in a log file, or in the output of a command, without generating any cumbersone new output (such as a standard grep would do): this is exactly the use of the -q option of grep. For example: for i in `grep -v '^#' /etc/passwd | cut -f1 -d:` grep $i /var/log/samba/log.smbd | grep -q 'failed to authenticate' if [ $? == 0 ] ; then mail -s 'Error in samba' $i <<EOM ...
  • 22.Nov.08
    man intro cmd | pfortuny | (0)
    $ man intro Introductory stuff on Unix (or BSD/Linux...) commands.
  • 08.Nov.08
    Is this a tty? shell | pfortuny | (0)
    That is a funny question to ask if you are a human (because you *should* know the answer). But it is not that dumb for a system. As a matter of fact, among the multiple tests the shell admits (man 1 test), there is a -t which serves specifically for that: $ test -t 0 returns 0 (that is, success or true in shell jargon) if the standard input (file descriptor 0) is open and is associated with a terminal. So, unless things are going pretty bad, the following $ test -t 0 && echo $? Should always print a 0. However, when a file ...
  • 06.Nov.08
    man man cmd | pfortuny | (0)
    $ man man Some useful info not to be underestimated.