Sponsored Content
Top Forums Shell Programming and Scripting To delete the common parts (version and suffix) to get the package name Post 302874179 by vgersh99 on Thursday 14th of November 2013 11:19:05 AM
Old 11-14-2013
Quote:
Originally Posted by in2nix4life
Code:
awk -F'-[0-9].*' '{print $1}'

Good idea, but there're multiple fields in a record/line. Adopting an idea:
Code:
awk -F'-[0-9]|[ ][ ]*' '{for(i=1;i<=NF;i+=2) print $i}' myFile

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Most common version of UNIX on production systems

I am new to UNIX (about a year) and learning as fast as I can. I am an instructor teaching UNIX and have two labs with Ultra 10 333 MHz, Sun Blade 1000 1 GHz, Blade 100, and Two Enterprise 250 Servers. We are currently teaching our classes using the Solaris 2.10 OS, downloaded in May 2006, I am not... (7 Replies)
Discussion started by: dutchman
7 Replies

2. UNIX for Dummies Questions & Answers

How to rename multiple files with a common suffix

Hi, There are multiple files like file1_11 file2_11 file3_11.....and so on. How to rename them such tht the suffix _11 is removed and they become file1, file2, file3. Any help is appreciated. Regards er_ashu (1 Reply)
Discussion started by: er_ashu
1 Replies

3. UNIX for Dummies Questions & Answers

package version

hi, I have this problem. I run a script to check which version of a given package is installed and I need something returning a meaningfull answer also if the installation was done with the sources. Let's say that, a priori, I do not know how the package was installed. So far I have... (0 Replies)
Discussion started by: gcastell
0 Replies

4. Shell Programming and Scripting

Delete parts of a string of character in one given column of a tab delimited file

I would like to remove characters from column 7 so that from an input file looking like this: >HWI-EAS422_12:4:1:69:89 GGTTTAAATATTGCACAAAAGGTATAGAGCGT U0 1 0 0 ref_chr8.fa 6527777 F DD I get something like that in an output file: ... (13 Replies)
Discussion started by: matlavmac
13 Replies

5. Debian

Package updated to same version

Hi, I recently did slight modifications to the basename utility from the coreutils package. I downloaded the source by typing "apt-get source coreutils", added a new option to the program, updated the respective manpage, build and installed it using "dpkg-buildpackage -uc -b && dpkg -i... (0 Replies)
Discussion started by: Gunther
0 Replies

6. Shell Programming and Scripting

Package version testing script

I was wondering if anyone already had a script to check rpm packages versions x.x.x or greater. so I could do a: # CheckRpmVersion Somepackage-1.2.3 And would output: whether the package is installed or not and if it was equal to or greater than the version 1.2.3. I know I can pull out... (0 Replies)
Discussion started by: Ikon
0 Replies

7. Shell Programming and Scripting

Remove version numbers from package lists

I just upgraded my laptop from Fedora 13 to 14, and normally, before I do the upgrade (Fresh install) I run an rpm command to make a list of all the packages I have installed, but without the version and architectures specified, so that I can just feed that list to yum after the upgrade to... (2 Replies)
Discussion started by: Tsuroerusu
2 Replies

8. Shell Programming and Scripting

Delete specific parts in a .txt file

Hi all, I desperately need a small script which deletes everything in a particular .txt file when "Abs = {" appears till "},", and also when "B-1 = {" appears till "}," I would like all the text in between of those instances to be deleted, however, other text to be unedited (kept as it is).... (12 Replies)
Discussion started by: c_lady
12 Replies

9. Solaris

Check that supersede of package version is installed

I need a programmatic way to check, that supersede of required package is installed. At Linux I do it using rpmvercm utility to compare installed package version to my minimal requirement. So - I need analog of Linux "rpmvercm" utility for Solaris (10/11) Let us say - I know that minimal version... (10 Replies)
Discussion started by: zuismanm
10 Replies

10. UNIX for Beginners Questions & Answers

How to install older package version on Ubuntu 18.04?

Hello, I'm running Ubuntu 18.04 and I would like to install libboost-python version 1.46. Currently I have installed version 1.65: wakatana@local-machine:~$ dpkg -l | grep libboost-python ii libboost-python-dev 1.65.1.0ubuntu1 amd64 ... (1 Reply)
Discussion started by: wakatana
1 Replies
IGAWK(1)							 Utility Commands							  IGAWK(1)

NAME
igawk - gawk with include files SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ... igawk [ all gawk options ] [ -- ] program-text file ... DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1). AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like @include getopt.awk in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path. OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports. EXAMPLES
cat << EOF > test.awk @include getopt.awk BEGIN { while (getopt(ARGC, ARGV, "am:q") != -1) ... } EOF igawk -f test.awk SEE ALSO
gawk(1) Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995. AUTHOR
Arnold Robbins (arnold@skeeve.com). Free Software Foundation Nov 3 1999 IGAWK(1)
All times are GMT -4. The time now is 02:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy