Be careful when doing this... Note that ALL SPACES MUST BE EXACT. Or else bash will cry:
#!/bin/bash
a=1
while [ $a -le 10 ]
do
echo "Loop number $a"
a=$(( $a + 1 ))
done
Programming solutions, source code, solutions to tech problems and other tech related stuff.
Showing posts with label commandline. Show all posts
Showing posts with label commandline. Show all posts
Thursday, December 16, 2010
Shell scripting for Mac (using bash)
An easy example using vi:
1. Type 'vi myscript' into the terminal.
2. Press 'i' for insert, and type your file. For example:
#!/bin/bash
echo "This is my script. Woo"
3. Press 'esc' key to exit insert mode.
4. Press shift+ZZ to save the file and exit.
5. Change the access rights on your file so it can be executed. For example:
chmod -x myscript
6. Execute your script by typing:
./myscript
That should get you started :)
1. Type 'vi myscript' into the terminal.
2. Press 'i' for insert, and type your file. For example:
#!/bin/bash
echo "This is my script. Woo"
3. Press 'esc' key to exit insert mode.
4. Press shift+ZZ to save the file and exit.
5. Change the access rights on your file so it can be executed. For example:
chmod -x myscript
6. Execute your script by typing:
./myscript
That should get you started :)
Tuesday, October 12, 2010
Deleting Sample Pictures on Blackberry Bold 9700
The BlackBerry Bold 9700 is a great mobile device, it even comes with some interesting sample pictures.
Although this causes a problem for some, since those built in sample pictures cannot be deleted easily (what a pain). So whether you're a space geek (I mean a geek that is concerned about those pictures taking up unnecessary space), or for some reason you have a fear of looking at one of those sample pictures (such as the peacock if you, for example, have pavophobia like this guy, or someone I know very well), don't be discouraged…
There IS a solution to remove them; but it is a pain of a solution for non technical users who just wanna get rid of them.
This is hardly what you'll want to hear, but you're going to have to get into the command line stuff with your BlackBerry.
1. Firstly, download JL Commander from here: http://www.blackberryfreaks.com/JL_Cmder.html.
2. Secondly, connect your blackberry and run the JL Cmder. Once you've loaded it select the command line interface option.
3. Once you're into the command line interface, run the following two commands, one by one:
javaloader -u erase -f net_rim_bb_medialoader_480x360_03_b.cod
javaloader -u erase -f net_rim_bb_medialoader_backgrounds_480x360_03_b.cod
4. Then once you restart your Blackberry those pesky pics and peacocks will be gone!
Although this causes a problem for some, since those built in sample pictures cannot be deleted easily (what a pain). So whether you're a space geek (I mean a geek that is concerned about those pictures taking up unnecessary space), or for some reason you have a fear of looking at one of those sample pictures (such as the peacock if you, for example, have pavophobia like this guy, or someone I know very well), don't be discouraged…
There IS a solution to remove them; but it is a pain of a solution for non technical users who just wanna get rid of them.
This is hardly what you'll want to hear, but you're going to have to get into the command line stuff with your BlackBerry.
1. Firstly, download JL Commander from here: http://www.blackberryfreaks.com/JL_Cmder.html.
2. Secondly, connect your blackberry and run the JL Cmder. Once you've loaded it select the command line interface option.
3. Once you're into the command line interface, run the following two commands, one by one:
javaloader -u erase -f net_rim_bb_medialoader_480x360_03_b.cod
javaloader -u erase -f net_rim_bb_medialoader_backgrounds_480x360_03_b.cod
4. Then once you restart your Blackberry those pesky pics and peacocks will be gone!
Subscribe to:
Posts (Atom)