Is GNU sed installed?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Is GNU sed installed?
# 8  
Old 10-01-2010
Quote:
Originally Posted by mcclunyboy
you could use "which" command to see if they are installed.
The which locate a command and display its pathname or alias.

The GNU version of sed gives with:
Code:
sed --version

an output like:
Code:
GNU sed version 4.1.5
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,
to the extent permitted by law.

# 9  
Old 10-01-2010
Quote:
Originally Posted by ygemici
Code:
for i in `find / -name "*sed" ; do pkgchk -l -p $i|tail -3 ; done

and if you want to learn version of gnu sed
Code:
 
which gsed && gsed --version | head -2

 
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