Sponsored Content
Full Discussion: Replacing $ in variable
Top Forums UNIX for Dummies Questions & Answers Replacing $ in variable Post 302171681 by ashish_uiit on Friday 29th of February 2008 07:22:06 AM
Old 02-29-2008
I am using while loop like

while read k

.....// if $DESTDIR is present in k then go to next line in file
because DESTDIR is not defined .
else
use value of k as it is it may be $PKG/$VERSION
as these variable are defined.

.....
done < $file
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replacing pattern in variable

My String variable is holding value as - abc"def I want to replce " with \" I tried with awk : echo $var | awk '{gsub(/"/,"\"");print}' and I am getting an error, `)' is not expected. (1 Reply)
Discussion started by: videsh77
1 Replies

2. Shell Programming and Scripting

Replacing set of characters with a value of a variable

I need to replace anything immediately after the pattern "standard01/" in a file with the value of a variable I don't know the length of the characters stored in that variable. - that might vary. I know there is some string after the pattern "standard01/", i don't know the what the string is or... (1 Reply)
Discussion started by: prekida
1 Replies

3. Shell Programming and Scripting

Help in replacing text with the value of a variable

Input file - tmp <begin> ./00003/ ./00004/ <end> I would like to replace "." with the value of pwd so that the output will look like /dev/project/00003/ t=`pwd` sed -e "s/\./$t/g" tmp > tmp1; The above piece of code is not working. Appreciate your help. (4 Replies)
Discussion started by: lotto_123
4 Replies

4. Shell Programming and Scripting

Replacing a pattern using variable?

ip1="xxx" ip2="bbb" sed 's/$ip1/$ip2/g' (3 Replies)
Discussion started by: shivarajM
3 Replies

5. UNIX for Dummies Questions & Answers

Replacing in a variable

Hi, If I have a variable var1 ='TH 12/1234' How can I set this too in a script var1 ='TH 12~1234' Bearing in mind "/" might be in a difference place each time and that the "/" might not even exist each time the variable is set. Thanks (3 Replies)
Discussion started by: belfastbelle
3 Replies

6. Shell Programming and Scripting

replacing line with variable

All I want to do is replace the 2nd line in a file with a variable, eg, var=xxx the file 'test' containing: aaa bbb ccc replace bbb with xxx aaa xxx ccc I had it working with sed on a redhat machine, but it doesn't work on a mac machine. (4 Replies)
Discussion started by: sideways
4 Replies

7. Shell Programming and Scripting

replacing ' ' and :'s with _'s in a variable

Hi guys In my shell script I have a variable that contains a string that contains the current time. I want to replace the spaces and colons in the value with underscores. TIME=`date` echo $TIME gives me: Thu Sep 24 16:40:53 BST 2009 I want it to show:... (4 Replies)
Discussion started by: alinaqvi90
4 Replies

8. Shell Programming and Scripting

replacing date with a variable in a file

Hi, I've a variable for example.. ACTIVATION_DATE=2010-11-11 (the date above is a result of a sql query and not hardcoded) now there is another file (test_2.parm) where there are many variables predefined.. REG_CODE=111 ACT_DATE=2010-10-10 CAN_DATE=8888-31-12 Now I want to search for... (1 Reply)
Discussion started by: RRVARMA
1 Replies

9. Shell Programming and Scripting

passing variable to another file and replacing

Hi all, I have a script in file1 which gets input from the user say variable "TYPE". This variable is present in the other file2. I want to replace the variable in the file2 with the value given by the user and print the file. How can I achieve this task? file1 code echo "Give... (3 Replies)
Discussion started by: Ananthdoss
3 Replies

10. Shell Programming and Scripting

Replacing a variable in a loop

input.txt I want to make 3 seprate ouputs such that toast1.txt ICH.txt ICH_SV.txt I have tried "echo" and "sed 's/k/toast1/g' to replace k, but its not quite working. Please help me out :) Thanks! (4 Replies)
Discussion started by: johnkim0806
4 Replies
DEBCHECKOUT(1)                                                                                                                      DEBCHECKOUT(1)

NAME
debcheckout - checkout the development repository of a Debian package SYNOPSIS
debcheckout [OPTIONS] PACKAGE [DESTDIR] debcheckout [OPTIONS] REPOSITORY_URL [DESTDIR] debcheckout --help DESCRIPTION
debcheckout retrieves the information about the Version Control System used to maintain a given Debian package (the PACKAGE argument), and then checks out the latest (potentially unreleased) version of the package from its repository. By default the repository is checked out to the PACKAGE directory; this can be overridden by providing the DESTDIR argument. The information about where the repository is available is expected to be found in Vcs-* fields available in the source package record. For example, the vim package exposes such information with a field like Vcs-Hg:http://hg.debian.org/hg/pkg-vim/vim, you can see it by grepping through apt-cache showsrc vim. If more than one source package record containing Vcs-* fields is available, debcheckout will select the record with the highest version number. Alternatively, a particular version may be selected from those available by specifying the package name as PACKAGE=VERSION. If you already know the URL of a given repository you can invoke debcheckout directly on it, but you will probably need to pass the appropriate -t flag. That is, some heuristics are in use to guess the repository type from the URL; if they fail, you might want to override the guessed type using -t. The currently supported version control systems are: Arch (arch), Bazaar (bzr), CVS (cvs), Darcs (darcs), Git (git), Mercurial (hg) and Subversion (svn). OPTIONS
GENERAL OPTIONS -a, --auth Work in authenticated mode; this means that for known repositories (mainly those hosted on http://alioth.debian.org) URL rewriting is attempted before checking out, to ensure that the repository can be committed to. For example, for Subversion repositories hosted on alioth this means that svn+ssh://svn.debian.org/... will be used instead of svn://svn.debian.org/.... -d, --details Only print a list of detailed information about the package repository, without checking it out; the output format is a list of fields, each field being a pair of TAB-separated field name and field value. The actual fields depend on the repository type. This action might require a network connection to the remote repository. Also see -p. This option and -p are mutually exclusive. -h, --help Print a detailed help message and exit. -p, --print Only print a summary about package repository information, without checking it out; the output format is TAB-separated with two fields: repository type, repository URL. This action works offline, it only uses "static" information as known by APT's cache. Also see -d. This option and -d are mutually exclusive. -P package, --package package When checking out a repository URL, instead of trying to guess the package name from the URL, use this package name. -t TYPE, --type TYPE Override the repository type (which defaults to some heuristics based on the URL or, in case of heuristic failure, the fallback "svn"); should be one of the currently supported repository types. -u USERNAME, --user USERNAME Specify the login name to be used in authenticated mode (see -a). This option implies -a: you don't need to specify both. -f, --file Specify that the named file should be extracted from the repository and placed in the destination directory. May be used more than once to extract mutliple files. --source=never|auto|download-only|always Some packages only place the debian directory in version control. debcheckout can retrieve the remaining parts of the source using apt-get source and move the files into the checkout. never Only use the repository. auto (default) If the repository only contains the debian directory, retrieve the source package, unpack it, and also place the .orig.tar.gz file into the current directory. Else, do nothing. download-only Always retrieve the .orig.tar.gz file, but do not unpack it. always Always retrieve the .orig.tar.gz file, and if the repository only contains the debian directory, unpack it. VCS-SPECIFIC OPTIONS GIT-SPECIFIC OPTIONS --git-track BRANCHES Specify a list of remote branches which will be set up for tracking (as in gitbranch--track, see git-branch(1)) after the remote Git repository has been cloned. The list should be given as a space-separated list of branch names. As a shorthand, the string "*" can be given to require tracking of all remote branches. CONFIGURATION VARIABLES
The two configuration files /etc/devscripts.conf and ~/.devscripts are sourced by a shell in that order to set configuration variables. Command line options can be used to override configuration file settings. Environment variable settings are ignored for this purpose. The currently recognised variables are: DEBCHECKOUT_AUTH_URLS This variable should be a space separated list of Perl regular expressions and replacement texts, which must come in pairs: REGEXP TEXT REGEXP TEXT ... and so on. Each pair denotes a substitution which is applied to repository URLs if other built-in means of building URLs for authenticated mode (see -a) have failed. References to matching substrings in the replacement texts are allowed as usual in Perl by the means of $1, $2, ... and so on. This setting can be used to enable authenticated mode for most repositories out there. Note that the Debian repositories on alioth.debian.org ($vcs.debian.org) are implicitly defined. Here is a sample snippet suitable for the configuration files: DEBCHECKOUT_AUTH_URLS=' ^w+://(svn.example.com)/(.*) svn+ssh://$1/srv/svn/$2 ^w+://(git.example.com)/(.*) git+ssh://$1/home/git/$2 ' Note that whitespace is not allowed in either regexps or replacement texts. Also, given that configuration files are sourced by a shell, you probably want to use single quotes around the value of this variable. DEBCHECKOUT_SOURCE This variable determines under what scenarios the associated orig.tar.gz for a package will be downloaded. See the --source option for a description of the values. SEE ALSO
apt-cache(8), Section 6.2.5 of the Debian Developer's Reference (for more information about Vcs-* fields): http://www.debian.org/doc/developers-reference/best-pkging-practices.html#bpp-vcs. AUTHOR
debcheckout and this manpage have been written by Stefano Zacchiroli <zack@debian.org>. Debian Utilities 2013-12-23 DEBCHECKOUT(1)
All times are GMT -4. The time now is 03:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy