Sponsored Content
Full Discussion: Storing a variable using sed
Top Forums Shell Programming and Scripting Storing a variable using sed Post 302897007 by MIA651 on Thursday 10th of April 2014 12:06:39 PM
Old 04-10-2014
Thanks vgersh99! Always the simplest mistakes!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Storing the output into a variable

Hi unix gurus, I am trying to store the result of a command into a variable. But it is not getting stored. x='hello' y=echo $x | wc -c but it is giving the output as 0(zero) Pls help me its very urgent (7 Replies)
Discussion started by: ravi raj kumar
7 Replies

2. Shell Programming and Scripting

Storing a variable?

I'm writing a bash shell script to backup several mysql databases. This script will run on a daily basis and send a copy to a remote FTP repository. The filenames are in the format DATE.backup.sql. How do I store the DATE variable so I can delete/move/etc the file on the FTP server the next time... (4 Replies)
Discussion started by: hoover90
4 Replies

3. Shell Programming and Scripting

sed - searching for string and storing in variable

Hi I'm trying to find a way to search a text file for a specific string. I have a file which contains i.p. addresses and port numbers in the following format: 'ip="www.xxx.yyy.zzz"' 'port="xx""' I want to print only the parts between the double quotes for use in seperate variables,... (4 Replies)
Discussion started by: melias
4 Replies

4. Shell Programming and Scripting

storing a command in a variable

how would i go about storing this command in a variable echo "$LINE" | awk -F"|" '{print $1"|"$2"|"$3"}' i have tried FOO = ${command up there} but receive the error FOO: not found aswell as a couple of other attempt but no luck (2 Replies)
Discussion started by: nookie
2 Replies

5. Shell Programming and Scripting

Storing value in a variable

Hi Everyone, I have a code which requires to be stored in different variables and I am achiving it like this. HOST=`echo $RMP | cut -f2 -d:` NAME=`echo $RMP | cut -f3 -d:` DIR=`echo $RMP | cut -f4 -d:` TYPE=`echo $RMP | cut -f5 -d:` Is there any other way of storing value... (2 Replies)
Discussion started by: gehlnar
2 Replies

6. Shell Programming and Scripting

About storing the value of wc -l into a variable and then using this value in while

Hi all, I m new to this forum. I ma facing onei issue. I have something like this: length= wc -l < b2| awk '{print $1}' where b2 is filename having detauls like: cat b2 abc1 abc4 xyc3 sbdghf4 but when I do echo "$length" it displays nothing Also I am using awk to overcome... (4 Replies)
Discussion started by: student2009
4 Replies

7. Shell Programming and Scripting

Storing a field within a variable

Hi, I need to figure out a way to to capture the contents of a field that is separated by a pipe sign. Example Data: -100F| some other description -10C| some description | some description As you can see, the length of the field on the left of the pipe can be any length and... (3 Replies)
Discussion started by: doza22
3 Replies

8. UNIX for Dummies Questions & Answers

Storing all the PID's in a variable.

Hi, ps -ef|awk '{print $2}' i want to store the result of the above command in a variable. I never worked with arrays in shell scripting. i tried the below code: set a=`ps -ef|awk '{print $2}'` But echo $a returns null. I want to store the content in a variable and retrieve it... (2 Replies)
Discussion started by: pandeesh
2 Replies

9. Shell Programming and Scripting

Storing output into a variable

My script below seems to be choking because I need the the output of the find command to be stored as a variable that can then be called by used lower in the script. #!/bin/bash cd "/resumes_to_be_completed" var1=find . -mmin -1 -type f \( -name "*.doc" -o -name "*.docx" \)... (1 Reply)
Discussion started by: binary-ninja
1 Replies

10. UNIX for Advanced & Expert Users

Passing variable as input & storing output in other variable

I have a below syntax its working fine... var12=$(ps -ef | grep apache | awk '{print $2,$4}') Im getting expected output as below: printf "%b\n" "${VAR12}" dell 123 dell 456 dell 457 Now I wrote a while loop.. the output of VAR12 should be passed as input parameters to while loop and results... (5 Replies)
Discussion started by: sam@sam
5 Replies
deb-version(5)							      Debian							    deb-version(5)

NAME
deb-version - Debian package version number format SYNOPSIS
[epoch:]upstream-version[-debian-revision] DESCRIPTION
Version numbers as used for Debian binary and source packages consist of three components. These are: epoch This is a single (generally small) unsigned integer. It may be omitted, in which case zero is assumed. If it is omitted then the upstream-version may not contain any colons. It is provided to allow mistakes in the version numbers of older versions of a package, and also a package's previous version num- bering schemes, to be left behind. upstream-version This is the main part of the version number. It is usually the version number of the original ("upstream") package from which the .deb file has been made, if this is applicable. Usually this will be in the same format as that specified by the upstream author(s); however, it may need to be reformatted to fit into the package management system's format and comparison scheme. The comparison behavior of the package management system with respect to the upstream-version is described below. The upstream-ver- sion portion of the version number is mandatory. The upstream-version may contain only alphanumerics ("A-Za-z0-9") and the characters . + - : ~ (full stop, plus, hyphen, colon, tilde) and should start with a digit. If there is no debian-revision then hyphens are not allowed; if there is no epoch then colons are not allowed. debian-revision This part of the version number specifies the version of the Debian package based on the upstream version. It may contain only alphanumerics and the characters + . ~ (plus, full stop, tilde) and is compared in the same way as the upstream-version is. It is optional; if it isn't present then the upstream-version may not contain a hyphen. This format represents the case where a piece of software was written specifically to be turned into a Debian package, and so there is only one "debianisation" of it and therefore no revision indication is required. It is conventional to restart the debian-revision at '1' each time time the upstream-version is increased. Dpkg will break the version number apart at the last hyphen in the string (if there is one) to determine the upstream-version and debian-revision. The absence of a debian-revision compares earlier than the presence of one (but note that the debian-revision is the least significant part of the version number). Sorting Algorithm The upstream-version and debian-revision parts are compared by the package management system using the same algorithm: The strings are compared from left to right. First the initial part of each string consisting entirely of non-digit characters is determined. These two parts (one of which may be empty) are compared lexically. If a difference is found it is returned. The lexical comparison is a comparison of ASCII values modified so that all the letters sort earlier than all the non-letters and so that a tilde sorts before anything, even the end of a part. For exam- ple, the following parts are in sorted order: '~~', '~~a', '~', the empty part, 'a'. Then the initial part of the remainder of each string which consists entirely of digit characters is determined. The numerical values of these two parts are compared, and any difference found is returned as the result of the comparison. For these purposes an empty string (which can only occur at the end of one or both version strings being compared) counts as zero. These two steps (comparing and removing initial non-digit strings and initial digit strings) are repeated until a difference is found or both strings are exhausted. Note that the purpose of epochs is to allow us to leave behind mistakes in version numbering, and to cope with situations where the version numbering scheme changes. It is not intended to cope with version numbers containing strings of letters which the package management sys- tem cannot interpret (such as 'ALPHA' or 'pre-'), or with silly orderings. CAVEATS
The tilde character and its special sorting properties were introduced in dpkg, version 1.10 and some parts of dpkg-dev only gained support for it later in the 1.10.x series. SEE ALSO
deb-control(5), deb(5), dpkg(1) Debian Project 2011-08-14 deb-version(5)
All times are GMT -4. The time now is 11:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy