Unix FAQ

How can you boot a solaris box interactively? i.e. it will ask you question before you load it and
if you want to load someting different (kernel, components and modules, rc scripts etc).

boot -a

----------------------------------------------------------------

What is the following program doing...

#include <stdio.h>

struct addr
{
char *who;
struct addr *next;
};

struct list
{
char *sys;
struct addr *adr;
};

typedef struct list nodes[2];

nodes gbl_list;

function(int rtype, char *who)
{
struct addr *adr1;

adr1 = (struct addr *)malloc(sizeof(struct addr));
adr1->who = who;

adr1->next = gbl_list[rtype].adr;
gbl_list[rtype].adr = adr1;

}

main()
{
int i;
struct addr *addr3;

function(0, "meerut.rpc");
function(0, "hpindas.rpc");
function(1, "mountd.rpc");
function(1, "rpcbind.rpc");

}

Though may seem complicated peice of code, this code does some pretty simple task, without bothering much.

It adds a node to the head of the linked list. Useful in conditions where you have to maintain a linked list by quantities e.g.
versions.

Though I don't call it the right type of coding to practice. It does very well in disguising itself and confusing others. Remember
you code should be clear, precise and objective. Language tweakings are not particularly helpful in achieving what every
developer dream - "speed".

----------------------------------------------------------------

I want an unix command that will search for an executable file(bits) in all the direstories.  eg, I have an executable of notepad stored in unix. and now I want to locate this executable and get a copy of it.  (how to I diffrentiate between a normal file and an executable file)

The find command has a -perm option that follows the chmod command. For example, this

find . -perm 777 -print

finds all the files in the current directory structure where the permissions are read-write-execute for everybody.

See Also
Unix Administrator Career Path

Have a Unix Problem
Do you have a UNIX Question?

Unix Books :-
UNIX Programming, Certification, System Administration, Performance Tuning Reference Books

Return to : - Unix System Administration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.
The site www.gotothings.com is in no way affiliated with or endorsed by any company listed at this site.
Any unauthorised copying or mirroring is prohibited.