Hi all,
I want to search for a data type in a line.For this in a loop i am checking for $DATA_TYPE in a line using grep.But grep is not able to find when i give this.
Can any one tell me how to check string in $DATA_TYPE variable in line usign grep (or) any other way to do the above task.
... (4 Replies)
Hello,
I'm running calculations and I need to extract a specific number from a output file. So far I've only been able to GREP entire lines containing the string: '1 F=' . I would like to go a step further and extract just the number following '1 F='. The entire line looks like:
1 F=... (10 Replies)
Hallo!
Example.
#!/bin/bash
BACKUP_DIR=/home/userx/backups/evolution
echo $BACKUP_DIR
# delete the first character from the string
BACKUP_DIR=$(echo $BACKUP_DIR | cut -c 2-)
echo $BACKUP_DIR
It works. It does want I want, delete the first character from string in the... (11 Replies)
I have two variables,
my $filename = "abc_yyyy_mm_dd.txt";
my $filename1 = " abc_2011_11_07.txt";
I need to perform some operations after checking if $filename has $filename1 in it
i have used the below code,
if($filename =~ /^$filename1/)
{
----
--
} (2 Replies)
Hi,
I've been stuck for several days on this. Using grep on a command line, I can use quotes, eg...
grep 'pattern of several words' filename
I want to do this in my bash script. In my script I have captured the several command line arguments (eg arg1 arg2) into a variable:
variable=$@
I... (2 Replies)
I am attempting to grep an exact string from a series of files within a directory and append that output to the filename when it is present in the file. I've been after this all day with no luck. Thanks for your help in advance :wall:. (4 Replies)
As the title says I'm running a korn script in attempts to find an exact match in named.conf
finddomain.ksh
#!/bin/ksh
#
echo "********** named.conf ************"
file=/var/named/named.conf
for domain in `cat $1`
do
grep -n '"\$domain "' $file
done
echo "********** thezah.inc... (1 Reply)
Hi ,
I am executing 2 queries and output is saved in file1.txt and file2.txt
example of file1.txt
Testing word Doc.docx,/Lab/Development and Validation/Multitest/MT_010708/Testing,Development and Validation,root,11-Mar-2014,,,,,
Testing Excel _.xlsx,/Lab/Development and... (3 Replies)
Here is the structure of my file:
MyFile.txt
g-4.n.g.fr 10.147.243.63 g-4.n.g.fr-w1
Here is my sript:
test.sh
#! /bin/sh
ip=10.147.243.63
worker=$(grep -e $ip $1 | awk '{ print $3; }')
echo ""
echo $worker
echo ""
echo $worker
echo ""
echo "$worker.v.1"
echo... (7 Replies)
Discussion started by: chercheur111
7 Replies
LEARN ABOUT DEBIAN
incr
incr(3tcl) Tcl Built-In Commands incr(3tcl)__________________________________________________________________________________________________________________________________________________NAME
incr - Increment the value of a variable
SYNOPSIS
incr varName ?increment?
_________________________________________________________________DESCRIPTION
Increments the value stored in the variable whose name is varName. The value of the variable must be an integer. If increment is supplied
then its value (which must be an integer) is added to the value of variable varName; otherwise 1 is added to varName. The new value is
stored as a decimal string in variable varName and also returned as result.
Starting with the Tcl 8.5 release, the variable varName passed to incr may be unset, and in that case, it will be set to the value incre- |
ment or to the default increment value of 1.
EXAMPLES
Add one to the contents of the variable x:
incr x
Add 42 to the contents of the variable x:
incr x 42
Add the contents of the variable y to the contents of the variable x:
incr x $y
Add nothing at all to the variable x (often useful for checking whether an argument to a procedure is actually integral and generating an
error if it is not):
incr x 0
SEE ALSO expr(3tcl)KEYWORDS
add, increment, variable, value
Tclincr(3tcl)