I am writing a shell script to search for previous versions of an application...the application is called TAU and basically i want to search the users home directory and /Applications for any instances of a "TAU" folder.. If found i want to give the user the option to remove the old folders and if... (3 Replies)
this is the content of the file:
i want to remove both the line starting with "=" and "(" but i can only remove one at a time..so how do I go about removing both of them? (15 Replies)
Hi guys,
Is there any way this can be done, or return whether any substitutions have been made?
thanks for any input.
skinnygav (using Bash shell) (2 Replies)
Hello
I have the following output which is returned with the Month in text format instead of numerical. The output I receive is performed by using Rational Synergy CM software commands from the Unix command line and piping Unix commands on the end.
bash-3.00$ ccm query -n... (4 Replies)
Is there anyway to accomplish this?
(ksh)
FILES_TO_PROCESS='NAME1 NAME2'
SOURCE_NAME1=/tmp/myfile
TARGET_NAME1=/somewhere/else
# other file names
for i in $FILES_TO_PROCESS
do
file1=SOURCE_$i
file2=TARGET_$i
echo cp ${$file1} ${$file2} <-- how do get this to work.
done (2 Replies)
Hello All,
I'm trying to extract the lines between two consecutive elements of an array from a file.
My array looks like:
problem_arr=(PRS111 PRS213 PRS234)
j=0
while } ]
do
k=`expr $j + 1`
sed -n "/${problem_arr}/,/${problem_arr}/p" problemid.txt
---some operation goes... (11 Replies)
Hello All,
I have something like below
LDC100/rel/prod/libinactrl.a
LAA2000/rel/prod/libinactrl.a
I want to remove till first forward slash that is outputshould be as below
rel/prod/libinactrl.a
rel/prod/libinactrl.a
How can I do that ??? (8 Replies)
Hey everyone! I am determining the best method to do what the subject of this thread says. I only have pieces to the puzzle right now. Namely this:
grep -rl "expression" . | xargs open
(I should mention that the intention is to grep through many files containing the "expression" and... (2 Replies)
Using a regular expression, I would like multiple lines to be matched.
By default, a period (.) matches any character except newline. However, (?s) and /s modifiers are supposed to force . to accept a newline and to match any character including a newline.
However, the following two perl... (4 Replies)
I am learning SED and just following the shell scripting book, i have trouble understanding the grep and sed statement,
Question : 1
__________
/opt/oracle/work/antony>cat teledir.txt
jai sharma 25853670
chanchal singhvi 9831545629
anil aggarwal 9830263298
shyam saksena 23217847
lalit... (7 Replies)
Discussion started by: Antony Ankrose
7 Replies
LEARN ABOUT DEBIAN
dpkg::substvars
Dpkg::Substvars(3) libdpkg-perl Dpkg::Substvars(3)NAME
Dpkg::Substvars - handle variable substitution in strings
DESCRIPTION
It provides some an object which is able to substitute variables in strings.
METHODS
my $s = Dpkg::Substvars->new($file)
Create a new object that can do substitutions. By default it contains generic substitutions like ${Newline}, ${Space}, ${Tab},
${dpkg:Version} and ${dpkg:Upstream-Version}.
Additional substitutions will be read from the $file passed as parameter.
It keeps track of which substitutions were actually used (only counting substvars(), not get()), and warns about unused substvars
when asked to. The substitutions that are always present are not included in these warnings.
$s->set($key, $value)
Add/replace a substitution.
$s->set_as_used($key, $value)
Add/replace a substitution and mark it as used (no warnings will be produced even if unused).
$s->get($key)
Get the value of a given substitution.
$s->delete($key)
Remove a given substitution.
$s->mark_as_used($key)
Prevents warnings about a unused substitution, for example if it is provided by default.
$s->no_warn($key)
Obsolete function, use mark_as_used() instead.
$s->load($file)
Add new substitutions read from $file.
$s->parse($fh, $desc)
Add new substitutions read from the filehandle. $desc is used to identify the filehandle in error messages.
$s->set_version_substvars($sourceversion, $binaryversion)
Defines ${binary:Version}, ${source:Version} and ${source:Upstream-Version} based on the given version strings.
These will never be warned about when unused.
$s->set_arch_substvars()
Defines architecture variables: ${Arch}.
This will never be warned about when unused.
$newstring = $s->substvars($string)
Substitutes variables in $string and return the result in $newstring.
$s->warn_about_unused()
Issues warning about any variables that were set, but not used
$s->set_msg_prefix($prefix)
Define a prefix displayed before all warnings/error messages output by the module.
$s->save($file)
Store all substitutions variables except the automatic ones in the indicated file.
"$s" Return a string representation of all substitutions variables except the automatic ones.
$str = $s->output($fh)
Print all substitutions variables except the automatic ones in the filehandle and return the content written.
AUTHOR
Raphael Hertzog <hertzog@debian.org>.
1.16.15 2014-06-05 Dpkg::Substvars(3)