vendredi 8 septembre 2017

How to find manual doc for bash $RANDOM special variable?

In Bash there are some variables (like $RANDOM) which are builtin functions. My understanding is that $RANDOM uses the C function random (e.g. man random).

But I had to stumble across that information. What I wanted to be able to do was something like man $RANDOM or type $RANDOM (or even help $RANDOM).

The problem with trying that is $RANDOM gets evaluated to the actual random number :-)

So how do you identify what the implementation is for a special builtin variable like $RANDOM? Other than sifting through Bash source code, which I just don't have the brain capacity for.

Surely there's a way to get the shell to indicate what implementation a special variable has (e.g. "this is a builtin variable that points to a C function of <N> name")

Or maybe there isn't? *shrugs*

Any help/info on this would be appreciated :-)

Thanks!




Aucun commentaire:

Enregistrer un commentaire