Operating System - HP-UX
1752298 Members
5147 Online
108786 Solutions
New Discussion юеВ

Re: GNU Coreutil HP-UX how to

 
SOLVED
Go to solution

GNU Coreutil HP-UX how to

Dear all

I have downloaded and installed coreutil depot form http://hpux.connect.org.uk/hppd/hpux/Gnu/coreutils-7.1/ and all it dependency

installation is sucessfull and the path it got installed is /usr/local/coreutil/bin and man page is /usr/loca/coreutil/share/man/man1

Now my questions are

1.How do i set path for coreutil commands?
May be by export PATH=$PATH:/usr/local/coreutil/bin
2.If we set path does Gnu coreutil and posix commands inside /usr/bin will conflict?
3.what are advantages,limitations and disadvantages of Gnu coreutil and POSIX commands?
4.Whether GNU Coreutil create any issues in future?
8 REPLIES 8
Dennis Handly
Acclaimed Contributor

Re: GNU Coreutil HP-UX how to

>installation is sucessful and the path it got installed is /usr/local/coreutil/bin

>1. How do i set path for coreutil commands?
>export PATH=$PATH:/usr/local/coreutil/bin

Yes.

>2. If we set path does Gnu coreutil and posix commands inside /usr/bin will conflict?

Yes, if they have the same names. You may want to rename each GNU command to start with "g".

>3. what are advantages, limitations and disadvantages of Gnu coreutil and POSIX commands?

You would have to compare each command.
One limitation is that you would have to install the GNU tools on each system.
Of course the HP-UX command have limitations in options, etc.

Re: GNU Coreutil HP-UX how to

Thanks for reply
But how to export manpath of coreutil?
Dennis Handly
Acclaimed Contributor

Re: GNU Coreutil HP-UX how to

>But how to export manpath of coreutil?

Either export MANPATH or use "man -M path".
export MANPATH=$MANPATH:/usr/loca/coreutil/share/man

Re: GNU Coreutil HP-UX how to

Dear Dennis

Thanks for your reply

What would happen if i replace POSIX commands with coreutil commands that means the df,time,sort,unique?

what will be the impact?
Steven Schweda
Honored Contributor

Re: GNU Coreutil HP-UX how to

> [...] if i replace [...]

What do you mean by "replace"?

> what will be the impact?

I can't be certain, but it's just possible
that this would depend on how you (or others)
use these programs.
Dennis Handly
Acclaimed Contributor
Solution

Re: GNU Coreutil HP-UX how to

>What would happen if I replace POSIX commands with coreutil commands that means the df, time, sort, unique?

(Hope you don't mean change the files in /usr/bin/? That would be bad.)

It depends. If the options are the same, just less limitations, it would work. You just need to clearly document that you depend on GNU.

Similarly if different options.
Having the commands prefixed with "g" would be a good indication of which you need. (Unless you are porting lots of scripts where they don't already have that "g".)

Re: GNU Coreutil HP-UX how to

Dear all
Thanks for all of them to clarify my doubts any how i will rename this utilities and use in Shell scripting

Thanks thanks thanks
James R. Ferguson
Acclaimed Contributor

Re: GNU Coreutil HP-UX how to

Hi:

>Thanks for all of them to clarify my doubts any how i will rename this utilities and use in Shell scripting

If I understand your question correctly, you have several options. One is to write your shell scripts in a fashion (something) like this:

#/usr/bin/sh
typeset tar=usr/local/coreutil/bintar
${tar} -tvf file

alias sed=/usr/local/coreutil/bin/sed
echo "how"|sed -e 's/how/thisway/'
...

Otherwise, declare the PATH in your script to simply contain '/usr/local/coreutil/bin' ahead of '/usr/bin'. This is somewhat risky from a security standpoint unless you strictly restrict who can populate the '/usr/local' directory, but is acceptable for individual scripts.

Lastly, as already stated, install the GNU utiliies with a "g" as the prefix so that a reference to 'gtar' is one to GNU's version.

Regards!

...JRF...