background preloader

Bash Scripting

Facebook Twitter

Android Engineer: Using Ant to Automate Building Android Applications. The standard way to develop and deploy Android applications is using Eclipse.

Android Engineer: Using Ant to Automate Building Android Applications

This is great because it is free, easy to use, and many Java developers already use Eclipse. To deploy your applications using Eclipse, you simply right-click on the on the project, choose to export the application, and follow the prompts There are a few things we cannot easily do with this system, though. Bash scripting Tutorial. Where did svn go after upgrading to OS X Mountain Lion 10.8 - Three Eyed Bird. We want to warn our blog followers first, this is going to be quite a bit more techy so if you are not interested in those kind of things, you'll want to avoid this post, otherwise, read ahead!

Where did svn go after upgrading to OS X Mountain Lion 10.8 - Three Eyed Bird

We recently discovered after upgrading to OS X Mountain Lion here at the nest that when we went to use SVN that the command was no longer found. It seems that Apple has removed the binary from normal OS X installs. Wait, what is SVN SVN, or subversion, is an open source version control system. This helps users, generally developers, keep versions of files and code as they work on a project together. Ok, so whats the deal and how do I fix it Since SVN is more of a developer tool, Apple has now moved it to be part of their Xcode developer package.

Now that you have it installed, you'll notice that the svn command still doesn't work in your terminal. A Command Line Primer for Beginners. It is a simple fact that probably better than 95% of the system adminning under both Linux and Windows can be done from the command prompt.

A Command Line Primer for Beginners

Fortunately for the safety and security of your system, there are no fancy GUI's with extensive, context sensitive help available for them. ...and those of us who know how a number of them work, won't tell you. You're welcome. For myself, I am a power user. That doesn't mean I use the most obscure methods possible, just for the geek cred, but use whatever gets the job done best, whether command line or GUI... or both.

For example, I just wrote a batch file to use wget & Image Magick to download Google Map sections and form them into a single, large image, which I then turn over to Photoshop to finish. My CLI is set to open as soon as I log in, and is the superlative NDN. Building and Running from the Command Line. There are two ways to build your application using the Ant build script: one for testing/debugging your application — debug mode — and one for building your final package for release — release mode.

Building and Running from the Command Line

Regardless of which way you build your application, it must be signed before it can install on an emulator or device—with a debug key when building in debug mode and with your own private key when building in release mode. Whether you're building in debug mode or release mode, you need to use the Ant tool to compile and build your project. This will create the .apk file that you can install on an emulator or device. When you build in debug mode, the .apk file is automatically signed by the SDK tools with a debug key, so it's instantly ready for installation onto an emulator or attached development device. Shell Programming! A working knowledge of shell scripting is essential to anyone wishing to become reasonably proficient at system administration, even if they do not anticipate ever having to actually write a script.

Shell Programming!

Consider that as a Linux machine boots up, it executes the shell scripts in /etc/rc.d to restore the system configuration and set up services. A detailed understanding of these startup scripts is important for analyzing the behavior of a system, and possibly modifying it. The craft of scripting is not hard to master, since scripts can be built in bite-sized sections and there is only a fairly small set of shell-specific operators and options to learn. The syntax is simple -- even austere -- similar to that of invoking and chaining together utilities at the command line, and there are only a few "rules" governing their use.

Most short scripts work right the first time, and debugging even the longer ones is straightforward. Advanced Bash-Scripting Guide. Shell Scripting Primer: Shell Script Basics. Bash wait command. Wait command stop script execution until all jobs running in background have terminated, or until the job number or process id specified as an option terminates.It returns the exit status of waited-for command. wait can take the job-id or the process number. i.e. wait%1 or wait $PID _________wait ${!}

Bash wait command

_________ wait ${!} ________________________An example on wait command Suppose- you have a script called sort_db.sh which sorts some data files and takes a lot of time to complete(you definitely want it to run as background process in your script)- One more script called bkptmp.sh, which does some job of backing up some tmp files(nowhere related to the above sort_db.sh)- You have to perform some tasks in your script after sort_db.sh and bkptmp.sh complete their individual tasks (Note: both the .sh should be completed before you perform the said operation)