LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-28-2014, 12:10 AM   #1
manalisharmabe
Member
 
Registered: Dec 2010
Posts: 242

Rep: Reputation: 1
How to link Sed from /usr/bin/sudo to /usr/local/bin/sed


Hi Guys,

OS:- Solaris 10 64Bit

I have a small query.

On one server a user is facing sed command issue.

He gets error regarding sed for this location

Code:
/users/hoy/2999/batch5/bin/internal.sh[69]: /usr/local/bin/sed:  not found
How ever the sed is actually present at this location on server:-

Code:
/usr/bin/sed

So I need to know How can I solve this problem?

I guess ln -s will do the trick here but need to know what exactly I need to do here?

And how to check version of sed here on the Server?

Please advise.

Thanks.
 
Old 01-28-2014, 01:28 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608Reputation: 3608
Quote:
Originally Posted by manalisharmabe View Post
So I need to know How can I solve this problem?
Edit /users/hoy/2999/batch5/bin/internal.sh and change the path to the binary if hardcoded?


Quote:
Originally Posted by manalisharmabe View Post
I guess ln -s will do the trick here
No. Given your questions I'd strongly suggest you don't focus on any "trickery" any time soon.


Quote:
Originally Posted by manalisharmabe View Post
And how to check version of sed here on the Server?
If 'sed -V' or 'sed --version' don't work see 'sed --help' or 'man sed'?
 
1 members found this post helpful.
Old 01-28-2014, 03:21 AM   #3
manalisharmabe
Member
 
Registered: Dec 2010
Posts: 242

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by unSpawn View Post
Edit /users/hoy/2999/batch5/bin/internal.sh and change the path to the binary if hardcoded?



No. Given your questions I'd strongly suggest you don't focus on any "trickery" any time soon.



If 'sed -V' or 'sed --version' don't work see 'sed --help' or 'man sed'?
From where can i download GNU version of sed?

sunfreeware.com is asking for paid membership.

and yes still i can t chek version of sed on solaris, above options does not work.
 
Old 01-28-2014, 03:41 AM   #4
manalisharmabe
Member
 
Registered: Dec 2010
Posts: 242

Original Poster
Rep: Reputation: 1
Hi all,



Thanks for reply.



I have downloaded GNU version of sed-4.2.2.tar.gz from this site.



Code:
ftp://ftp.gnu.org/gnu/sed


BUt I need to know how to install it.



After doing gunzip I got this in folder:-



Code:
-bash-3.2$ ls
ABOUT-NLS       COPYING         INSTALL         NEWS            THANKS          bootstrap       config_h.in     doc             po
AUTHORS         COPYING.DOC     Makefile.am     README          aclocal.m4      bootstrap.conf  configure       lib             sed
BUGS            ChangeLog       Makefile.in     README-alpha    basicdefs.h     build-aux       configure.ac    m4              testsuite
-bash-3.2$


-bash-3.2$ ls
ABOUT-NLS COPYING INSTALL NEWS THANKS bootstrap config_h.in doc po
AUTHORS COPYING.DOC Makefile.am README aclocal.m4 bootstrap.conf configure lib sed
BUGS ChangeLog Makefile.in README-alpha basicdefs.h build-aux configure.ac m4 testsuite
-bash-3.2$


Need to know how to install it, I also need to make sure that it is installed in /usr/local/bin.



Please advise.



Thanks
 
Old 01-28-2014, 09:43 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,597

Rep: Reputation: 8138Reputation: 8138Reputation: 8138Reputation: 8138Reputation: 8138Reputation: 8138Reputation: 8138Reputation: 8138Reputation: 8138Reputation: 8138Reputation: 8138
Quote:
Originally Posted by manalisharmabe View Post
Hi all,
Thanks for reply.

I have downloaded GNU version of sed-4.2.2.tar.gz from this site.
Code:
ftp://ftp.gnu.org/gnu/sed
BUt I need to know how to install it. After doing gunzip I got this in folder:-
Code:
-bash-3.2$ ls
ABOUT-NLS       COPYING         INSTALL         NEWS            THANKS          bootstrap       config_h.in     doc             po
AUTHORS         COPYING.DOC     Makefile.am     README          aclocal.m4      bootstrap.conf  configure       lib             sed
BUGS            ChangeLog       Makefile.in     README-alpha    basicdefs.h     build-aux       configure.ac    m4              testsuite
-bash-3.2$
Need to know how to install it, I also need to make sure that it is installed in /usr/local/bin.
Did you try to READ THE INSTRUCTIONS??? Can you not see bot the README and INSTALL files...which, amazingly, tell you how to perform the installation. Also, you DO know that you can get this as a Solaris package, right???

And did you read post #2, where you were given a solution? You need to change the path in the script....there is NO REASON to do what you're doing. And installing a new version of sed on a server is something your systems administrator needs to do, and then they only need to do it if there is a VERY good reason to.
 
1 members found this post helpful.
Old 01-28-2014, 10:42 PM   #6
manalisharmabe
Member
 
Registered: Dec 2010
Posts: 242

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by TB0ne View Post
Did you try to READ THE INSTRUCTIONS??? Can you not see bot the README and INSTALL files...which, amazingly, tell you how to perform the installation. Also, you DO know that you can get this as a Solaris package, right???

And did you read post #2, where you were given a solution? You need to change the path in the script....there is NO REASON to do what you're doing. And installing a new version of sed on a server is something your systems administrator needs to do, and then they only need to do it if there is a VERY good reason to.
Thanks,

This is what INSTALL file say:-
Code:
  On Solaris, don't put `/usr/ucb' early in your `PATH'.  This
directory contains several dysfunctional programs; working variants of
these programs are available in `/usr/bin'.  So, if you need `/usr/ucb'
in your `PATH', put it _after_ `/usr/bin'.

   On Haiku, software installed for all users goes in `/boot/common',
not `/usr/local'.  It is recommended to use the following options:

     ./configure --prefix=/boot/common
As I need to install GNU version of sed in /usr/local/bin

do I need to do :- ./configure --prefix=/usr/local/bin ???

Please advise.

Modifying the script is last option.

By the way is there any site which can give me GNU version of sed in Solaris package format , that would be really nice.

Thanks a lot.

Last edited by manalisharmabe; 01-29-2014 at 02:54 AM.
 
Old 01-29-2014, 09:29 AM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,597

Rep: Reputation: 8138Reputation: 8138Reputation: 8138Reputation: 8138Reputation: 8138Reputation: 8138Reputation: 8138Reputation: 8138Reputation: 8138Reputation: 8138Reputation: 8138
Quote:
Originally Posted by manalisharmabe View Post
Thanks,
This is what INSTALL file say:-
Code:
  On Solaris, don't put `/usr/ucb' early in your `PATH'.  This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'.  So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'.

On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'.  It is recommended to use the following options:
     ./configure --prefix=/boot/common
As I need to install GNU version of sed in /usr/local/bin do I need to do :- ./configure --prefix=/usr/local/bin??? Please advise.
Again, if you can't understand the installation instructions, it's best if you don't actually try to USE THEM. Get your systems administrator to do this...the above snippet you posted is very clear. It's telling you to put your PATH in a certain order, to avoid getting them called too early in the build process.
Quote:
Modifying the script is last option.
No, modifying the script is the FIRST and BEST option. Putting multiple versions of SED out on a production system in different paths, or making symbolic links all over the place to accommodate ONE BROKEN SCRIPT is the 'last option'. Your systems administrator should be able to tell you all the reasons doing what you're doing is a bad idea.
Quote:
By the way is there any site which can give me GNU version of sed in Solaris package format , that would be really nice.
You can look things up for yourself, thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
difference between /usr/local/bin & /usr/bin cgirishaanekal Linux - Newbie 2 07-19-2012 02:18 AM
[SOLVED] bash: /usr/local/bin/xdsi: /usr/bin/wish: bad interpreter: No such file or directory Berwhale Linux - Newbie 2 09-15-2011 02:59 PM
[SOLVED] Kickoff Application Launches from /usr/bin rather than /usr/local/bin Tim Johnson Slackware 2 05-26-2010 09:36 PM
echo $PATH = /home/g3rc4n/bin:/usr/local/bin:/usr/bin:/bin:/usr/games ? i_heart_pandas Linux - Software 7 09-18-2009 08:33 AM
path in services wrong for clamav updated frm 0.75 to 0.80 usr/bin vs usr/local/bin Emmanuel_uk Linux - Newbie 3 04-22-2005 01:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration