C Programming & Pointers

As a PHP developer  I find the pointers in C are weird and I always mess up trying to use them, hopefully I’ll have a better understanding now. I found this pretty great video tutorial with Richard Buckland, whom gives a great description about pointers. Start from 4:30 as the prior is just gossip.

There are a great number of lectures for this course. I can recommend watching them if you’re interested in getting to learn how to program.

 

A feature I love with the csh / tcsh

The foreach command which I never remember how to do, is a very powerful tool in the csh, which is missed in bash.

For those who don’t know it, foreach can be used in the command line interface (cli) in csh, unlike some other shells.

With foreach you can do some very simple directory work without having to first make a shell script.

Below is a very simple way of using the command.

First lets prepare something to work with, create a test dir that can be easily be removed afterwards

# mkdir test && cd test

Prepare some directories. these can also be files if you want to work with this.

# mkdir 1 2 3 4 5 6 7 8 9

The few commands to populate each directory from 1-9 with a file called test

# foreach file (*)
# cd $file && touch test && cd ..
# end

Now go and take a look in each directory, and you’ll see a file called test.