we know perl gives us the facility to use hashes

%ages = ('Martin' => 28, 'Sharon' => 35, 'Rikke' => 29);

what if I want to do the same thing in shell script ??

thanks

Recommended Answers

At least in the bash and korn shells there are associative arrays, essentially hashes.

See this for bash and this for korn.

Jump to Post

All 3 Replies

At least in the bash and korn shells there are associative arrays, essentially hashes.

See this for bash and this for korn.

It depends upon what you want to do. In bash scripts you can assign the output of any other executable to a variable using the back-quote character, as in:

varname=`md5sum filename`

It depends upon what you want to do.

Sorry rubberman, but did you maybe reply in the wrong thread?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.