Friday, May 29, 2009

Sun Solaris - Some More Productive Tips

In my last post about sunsolaris i talked about the use of semicolon in
automating and combining many tasks in sun solaris. today i will explore
another feature that combined with semicolon can make your working in sun
solaris a lot easier.

Before i go into that, i will tell you about a .cshrc file thats always there in
your home directory. Its the file that we will be using. I don't have much
knowledge about this file but this works like the autoexec.bat file of windows
and can always load during logon and can be used to do some of the cool features that you can customize.


We will be using the command alias in this file to automate some of the
commands that you use on a daily basis. The things you can do is limitless.

Here i will represent some of the common things that i have used it for.

I always develop in a folder and every time i don't want to use
cd /h/username/folder1/folder2/folder3

writing this is tedious so i have written an alias which does this for me.

alias cd1  'cd /h/username/folder1/folder2/folder3'


This line i have pasted in the .cshrc file. To use it you need to logout and
login again.

Same way i use a trial version of the software and i have to type series of
commands to compile and execute the program. this has been done by using.

alias tt64 'make clean; make sun64;strcalc -p -input sss.dat'

Now here tt64 is the command that i have to type at teh command promt and it
does the following make clean, then compiling the program for 64 bit and the
starts the strcalc program with all the options.

Easy isn't it?

As you all know i having using windows all my life till now, so teh habit of
doing cls, dir, calling calc and notepad remains. so for those i have written the
following alias

alias calc 'dtcalc &'
alias cls 'clear'
alias dir 'ls'
alias n ' nedit &'

This all call the relevant programs from the sun environment and i can use the
default already known cals, dir, cls commands at teh command prompt.

So how are you going to use it in your program. Here are some simple things taht
you should know when creating this shortcuts.

  • break down your tasks that you do repeatedly.
  • make series of allias for them.
  • keep it simple
  • keep it short
  • divide and conqure if the task is long, divide it into subtask and impliment them.

Search This Blog