Is GNU sed installed?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Is GNU sed installed?
# 1  
Old 10-01-2010
Is GNU sed installed?

Hi there,

I'm new to UNIX and have the following question:

At work a Solaris Unix system is used. I'm not sure if they have gnu sed installed so I tried using the command "sed -r" and got the error:
"Illegal option --r"

Does this mean that gnu sed is definitely not installed on the system or could it be there somewhere but is not called by default?

Thanks in advance for any advice!

js
# 2  
Old 10-01-2010
GNU stuff are not standard on commercial UNIX... except perhaps gzip...
All the rest depends on what the admins use... and usually the way of thinking is "stay the more standard as possible"...
Some admins (like me...) tend to if needed install GNU utilities just there where needed AND use a prefix where name exist already to avoid messing up the system so you would get a gfind, gawk etc... and preferably keeping them in /usr/local/bin
I would not install GNU utilities without using gcc so look if gcc is present to start with...
# 3  
Old 10-01-2010
Thanks for the quick answer! I had a look in /usr/local/bin but there was no version of sed there.

There are sed programs in the folders usr/xpg4/bin, usr/ucb/. You wouldn't know off-hand if either of these are the gnu sed version?
# 4  
Old 10-01-2010
What is it that you think sed can do than nawk cannot do ? If GNU is not available and if you desire, install it. Otherwise, the next best thing is nawk.
# 5  
Old 10-01-2010
you could use "which" command to see if they are installed.
# 6  
Old 10-01-2010
Code:
for i in `find / -name "*sed" ; do pkgchk -l -p $i|tail -3 ; done


Last edited by ygemici; 10-01-2010 at 02:44 PM..
# 7  
Old 10-01-2010
Note that on Solaris, gnu sed is often called gsed (like gtar, ggrep, gmake, gawk and others) so the previously suggested commands looking for a file named "sed" will fail despite gnu sed being there.

Many gnu tools are bundled or installed from common repositories in Solaris. Usual locations would be /usr/sfw/bin, /opt/sfw/bin, /opt/csw/bin and /usr/local/bin.

Solaris 11 will likely have gsed in /usr/bin.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Bash find version of an installed application but if none is found set variable to App Not Installed

Hello Forum, I'm issuing a one line bash command to look for the version of an installed application and saving the result to a variable like so: APP=application --version But if the application is not installed I want to return to my variable that the Application is not installed. So I'm... (2 Replies)
Discussion started by: greavette
2 Replies

2. Shell Programming and Scripting

GNU sed running on Mac

Super basic question. I installed sed GNU on a MAC running High Sierra. However, when I run sed '1i>sometext, I get the following error: sed: 1: "1isometext"; command i expects \ followed by text I have added the \ with no success. Is there anyway I can run sed and awk on MAC in the... (5 Replies)
Discussion started by: Xterra
5 Replies

3. Shell Programming and Scripting

Insert @Line # - SED (non-GNU)

Just posted on another fellow's question using ed, but I wanted to know about doing it with sed on Unix. For example - I have a file of an unknown length, but I want to add a line after the shell declaration (Line 2). If possible, I'd like the example to be able to just substitute in a number and... (2 Replies)
Discussion started by: Vryali
2 Replies

4. Shell Programming and Scripting

Unexpected results with lists in GNU sed

I have been living with this problem with GNU sed v4.1.4 for a long time, but now I really need to figure it out. When using a list in either an address or a search, the expression is matching lower and upper-case letters. works as it should. For example, if I run sed -nr "// p"... (7 Replies)
Discussion started by: nctrader
7 Replies

5. OS X (Apple)

GNU Sed Problem

Hi, I'm and Android developer using Mac OSX 10.7. I use Dsixda's Android Kitchen to develop my roms. I had it working fine on 10.6.8 and it still worked flawlessly when updating to 10.7. I installed Macports, and installed some packages, and then tried to run the Android Kitchen. I CD'd to the... (3 Replies)
Discussion started by: dmeadows013
3 Replies

6. Red Hat

Trouble with installed / not installed rpm unixODBC/libodbc.so.1

Hey there, i run 1: on my server (RHEL 6) and getting response that the libodbc is not installed. If i use yum for installation, it tells me, there is no package like this ( 2: ). Since in the description of Definiens is mentioned that the Run-time dependency is unixODBC (libodbc.so.1), I assume... (2 Replies)
Discussion started by: rkirsten
2 Replies

7. Solaris

Cannot run installed GNU compiler, Solaris 10

Am new to Solaris OS and need to install the GNU cpp compiler. Followed the instructions from Sunfreeware for installing the gcc compiler and it looks as if it correctly installed but i cannot run it from the command window. # cd /usr/local/bin # ls c++ ... (2 Replies)
Discussion started by: brb
2 Replies

8. UNIX and Linux Applications

GNU sed - Search and Replace problem

Hi, The following code loops through every file with an error extension and then loops through all XML files in that directory and replaces the target character @ with / . The problem I have is that if there is more than one occurance of @ in each individual file it doesn't replace it. Any... (2 Replies)
Discussion started by: Fishn
2 Replies

9. Shell Programming and Scripting

gnu sed replace space with new line

please help in making sed singleline command i need to insert dos new line (CR LF) before " 34 matching device(s) found on \\cpu1." " 6 matching device(s) found on \\cpu7." " 102 matching device(s) found on \\mainserver." the problem is that sometimes there are both CR LF before strings and... (1 Reply)
Discussion started by: xserg
1 Replies

10. Shell Programming and Scripting

gnu sed regex grouping not working?

Hello, from the gnu sed manual, I should be able to do this: `\(REGEXP\)' Groups the inner REGEXP as a whole, this is used to: * Apply postfix operators, like `\(abcd\)*': this will search for zero or more whole sequences of `abcd', while `abcd*' ... (3 Replies)
Discussion started by: Allasso
3 Replies
Login or Register to Ask a Question