Skip to Content

admin's blog

Bash Loops

While

Counting to 3 and doing something along the way right on the command line.


# i=1; while [ "$i" -lt 4 ]; do echo $i; i=$(($i+1)); done
1
2
3

The same command in a script:

#!/bin/bash
i=0
while [ "$i" -lt 10 ]
do
   echo $i
   i=$(($i+1))
done

For

Iterate through lines in a file with a for loop on the command line.


# for a in $(cat /tmp/users); do echo $a; done
usera
userb

In a script:

#!/bin/bash
for a in $(cat /tmp/users)
do

Creating ISO Filesystems

ISO filesystems are helpful for creating disk images for burning CDs.

On Nix:

mkisofs /tmp/isoname.iso -R -V "Volume Name" /path/to/iso/dir



If you have a DMG file you would like to convert to an ISO, you might find this article helpful on macosxhints.com:

http://www.macosxhints.com/article.php?story=20040121135301830&query=dmg+to+iso

Drupal Attachments

Posted in

Here is how attachments show up in drupal. Anonymous users aren't going to see the attachment.

Syndicate content