How to link sed from /usr/bin/sed to /usr/local/bin/sed?


Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
Operating Systems Solaris How to link sed from /usr/bin/sed to /usr/local/bin/sed?
# 1  
How to link sed from /usr/bin/sed 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.
# 2  
Have your looked at internal.sh on line 69 ? Chances are there is a call to /usr/local/bin/sed, wereas on your system it is located in /usr/bin. If so, the script would need to be adjusted..
# 3  
The person who wrote internal.sh presumably specified /usr/local/bin/sed because the version of sed installed in that location had some feature that was not available in /usr/bin/sed on the system where the script was deployed. If you can find the author of that script, find out from them what version of sed the script needs to work correctly and install it as /usr/local/bin/sed on the server in question. If you can't find the author, but can find out what system was running this script, find out what version of sed is installed in /usr/local/bin on that system.

If you can't find the person that wrote the script and can't figure out which system the script came from, get someone who knows sed to examine the way the script uses options and regular expressions to determine why the author didn't just use /usr/bin/sed. Then, either rewrite the script to use "standard" sed options and BREs or change it to reference a different version of sed on your Solaris System that has the desired features (/usr/xpg4/bin/sed, /usr/gnu/bin/sed, ).

You could use ln -s to set up a symlink, but that defeats the purpose of /usr/local/bin. If the script can use /usr/bin/sed instead of /usr/local/bin/sed, change the script to just use sed (or explicitly use /usr/bin/sed) rather than /usr/local/bin/sed.
# 4  
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$

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.

Please advise.

Thanks

Last edited by Scrutinizer; 01-28-2014 at 08:57 AM.. Reason: addtional code tags
# 5  
If you have a program named gunzip installed, do you also have gsed installed?

When you download software and it includes a file named README, I think it should be obvious that you should start by reading that file. Then, at a minimum, read the files INSTALL, Makefile.am and Makefile.in, ABOUT-NLS, BUGS, and NEWS. Assuming that sed and testsuite are directories, I would also look at the files in them. If you're curious (or paranoid), look at all of the files you downloaded!

Then, if the instructions on what to do to install GNU sed as /usr/local/bin/sed weren't clear, show us the instructions you didn't understand.
This User Gave Thanks to Don Cragun For This Post:
# 6  
Quote:
Originally Posted by Don Cragun
If you have a program named gunzip installed, do you also have gsed installed?
/usr/bin/gunzip belongs to Solaris since a decade (package SUNWgzip).
This User Gave Thanks to MadeInGermany For This Post:
# 7  
Redme file has nothing:-
Code:
-bash-3.2$ cat README
This is the GNU implementation of sed, the Unix stream editor.
See the NEWS file for a brief summary and the ChangeLog for
more detailed descriptions of changes.
See the file INSTALL for generic compilation and installation
instructions.
See the file BUGS for instructions about reporting bugs.
The file README.boot gives instructions for making a "bootstrap"
version of sed on systems which lack any pre-existing and working
version of sed.
-bash-3.2$

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.
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #243
Difficulty: Easy
The starting point for host-to-host communication on the ARPANET in 1969 was the 1822 protocol.
True or False?

9 More Discussions You Might Find Interesting

1. BSD

FreeBSD: /usr/bin/ld not looking in /usr/local/lib

I'm not sure if this is the default behavior for the ld command, but it does not seem to be looking in /usr/local/lib for shared libraries. I was trying to compile the latest version of Kanatest from svn. The autorgen.sh script seems to exit without too much trouble: $ ./autogen.sh checking... (2 Replies)
Discussion started by: AntumDeluge
2 Replies

2. Shell Programming and Scripting

/usr/local/bin/expr function not working

Legends, I am not able to set "expr" function in ksh script. Below is the sample code i used, and output is as "Syntax error" Please help me to come out of it. OUTPUT (9 Replies)
Discussion started by: sdosanjh
9 Replies

3. AIX

/usr/local/bin/cvs: Not found

I can able to access /usr/local/bin/cvs in the terminal (AIX 6.1 Box). but i am getting the "/usr/local/bin/cvs: Not found " when i call it from the script. please some one assist me what maybe problem (6 Replies)
Discussion started by: hifirockz
6 Replies

4. Solaris

What is the difference between xpg4/bin and usr/bin?

Hi Experts, I found that the same commands(sort, du, df, find, grep etc.) exists in both dir. What is the difference to use them? i.e: to use xpg4/bin/grep and usr/bin/grep My OS version is SunOS 5.10 Regards, Saps (7 Replies)
Discussion started by: saps19
7 Replies

5. OS X (Apple)

When to use /Users/m/bin instead of /usr/local/bin (& whats the diff?)?

Q1. I understand that /usr/local/bin means I can install/uninstall stuff in here and have any chance of messing up my original system files or effecting any other users. I created this directory myself. But what about the directory I didn't create, namely /Users/m/bin? How is that directory... (1 Reply)
Discussion started by: michellepace
1 Replies

6. Solaris

Questions about /usr/local/bin & scripts.

Hi gentlemen. For what intended is the directory /usr/local/bin? In this directory are some script. I don't understand how these scripts being in this directory are started. Each time after registration of the user occurs start of these scripts. These scripts start applications. (7 Replies)
Discussion started by: wolfgang
7 Replies

7. UNIX for Dummies Questions & Answers

Alias /usr/bin to /bin in profile

Hi! All the basic linux commands, ie. echo, find, etc, are located in /bin. I have a couple of programs that have these commands pointed towards /usr/bin, ie, /usr/bin/echo (even though the actual 'echo' command is in /bin). How can I alias or redirect or link the /usr/bin to /bin just for this... (6 Replies)
Discussion started by: dancerat
6 Replies

8. Solaris

How do I link ld in /usr/ucb/ to /usr/ccs/bin?

Hi all, below is the problem details: ora10g@CNORACLE1>which ld /usr/ucb/ld ora10g@CNORACLE1>cd /usr/ccs/bin ora10g@CNORACLE1>ln -s /usr/ucb/ld ld ln: cannot create ld: File exists ora10g@CNORACLE1> how to link it to /usr/ccs/bin? (6 Replies)
Discussion started by: SmartAntz
6 Replies

9. UNIX for Dummies Questions & Answers

/bin/sh: /usr/bin/vi: No such file or directory when doing crontab

I just set up an ftp server with Red Hat 5.2. I am doing the work, I'm baby stepping, but it seems like every step I get stuck. Currently, I'm trying to set up a crontab job, but I'm getting the following message: /bin/sh: /usr/bin/vi: No such file or directory. I see that vi exists in /bin/vi,... (3 Replies)
Discussion started by: kwalter
3 Replies

Featured Tech Videos