Sponsored Content
Top Forums Shell Programming and Scripting Comparison of two variables with IF loop Post 302758971 by Scrutinizer on Monday 21st of January 2013 06:13:25 AM
Old 01-21-2013
And a single = instead of ==
This User Gave Thanks to Scrutinizer For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with if loop (string comparison)

Hi Can someone please tell me what is wrong with this (ksh).. if + ]] then echo ${COMP_TEMP} fi What i need here is, say if the variable is a 1 or 2 digit number, then execute the if loop. Basically the variable can either be 1-30 or some other character sequence say '?', '&&'... (4 Replies)
Discussion started by: psynaps3
4 Replies

2. Shell Programming and Scripting

Is there a better way I could have run this loop. (For loop with two variables)

Sorry for such a dreadful title, but I'm not sure how to be more descriptive. I'm hoping some of the more gurutastic out there can take a look at a solution I came up with to a problem, and advice if there are better ways to have gone about it. To make a long story short around 20K pieces of... (2 Replies)
Discussion started by: DeCoTwc
2 Replies

3. Shell Programming and Scripting

Using variables created sequentially in a loop while still inside of the loop [bash]

I'm trying to understand if it's possible to create a set of variables that are numbered based on another variable (using eval) in a loop, and then call on it before the loop ends. As an example I've written a script called question (The fist command is to show what is the contents of the... (2 Replies)
Discussion started by: DeCoTwc
2 Replies

4. UNIX for Advanced & Expert Users

Comparison and For Loop Taking Too Long

I'd like to 1. Check and compare the 10,000 pnt files contains single record from the /$ROOTDIR/scp/inbox/string1 directory against 39 bad pnt files from the /$ROOTDIR/output/tma/pnt/bad/string1 directory based on the fam_id column value start at position 38 to 47 from the record below. Here is... (1 Reply)
Discussion started by: hanie123
1 Replies

5. Shell Programming and Scripting

String comparison not working inside while loop

Hi, In the code included below, the string comparision is not working fine. Please help while (( find_out >= i )) do file=`head -$i f.out|tail -1` dir=`dirname $file` cd $dir Status="" if ; then Status=`cvs -Q status... (3 Replies)
Discussion started by: sudvishw
3 Replies

6. Shell Programming and Scripting

string comparison not working inside while loop

The string comparison highlighted below is not working fine. Please help: while read line do # Get File name by deleting everything that preceedes and follows Filename as printed in cvs status' output f_name=`echo $line | sed -e 's/^File://' -e 's/ *Status:.*//' | awk '{print $NF}'` ... (4 Replies)
Discussion started by: sudvishw
4 Replies

7. Shell Programming and Scripting

for loop with 2 variables

i am having a file contants as below my requirement is for file in `awk -F "," '{print $8,$9}'` <temp.txt echo "$file" echo "$file">test.txt a=`awk -F "," '{print $1}' `<test.txt b=`awk -F "," '{print $2}' `<test.txt but script reads , i want both the vales for further... (5 Replies)
Discussion started by: sagar_1986
5 Replies

8. Shell Programming and Scripting

While loop for comparison

hi all, i have two files: test1 contains : one two three four five (on separate lines) test2 contains: one ten nine (on separate lines) I want to compare two files, test1 against test2. if any word from test1 does not match test2 display it. can someone help me with a while loop on this. ... (4 Replies)
Discussion started by: sbk785
4 Replies

9. Shell Programming and Scripting

awk - 2 files comparison without for loop - multi-line issue

Greetings Experts, I need to handle the views created over monthly retention tables for which every new table in YYYYMMDD format, there is equivalent view created and the older table which might be dropped, the view over it has to be re-created over a dummy table so that it doesn't fail.... (2 Replies)
Discussion started by: chill3chee
2 Replies

10. Shell Programming and Scripting

Help with variables in loop

Hello, please assist: users="test1 test2" keytest1="abcd" keytest2="dbcd" for i in $users do echo "$key${i}" > fileout done So, my objective is to take the current user (ie test1) in loop and echo its associated keyname (ie keytest1) variable to a file. The echo... (2 Replies)
Discussion started by: motdman
2 Replies
XTOKID(1)							   User Commands							 XTOKID(1)

NAME
xtokid - Print all tokens found in a source file SYNOPSIS
xtokid [OPTION]... [FILE]... DESCRIPTION
Print all tokens found in a source file. -i, --include=LANGS include languages in LANGS (default: "C C++ asm") -x, --exclude=LANGS exclude languages in LANGS -l, --lang-option=L:OPT pass OPT as a default for language L (see below) -m, --lang-map=MAPFILE use MAPFILE to map file names onto source language -d, --default-lang=LANG make LANG the default source language -p, --prune=NAMES exclude the named files and/or directories --files0-from=F tokenize only the files specified by NUL-terminated names in file F --help display this help and exit --version output version information and exit The following arguments apply to the language-specific scanners: C language: -k,--keep=CHARS Allow CHARS in single-token strings, keep the result -i,--ignore=CHARS Allow CHARS in single-token strings, toss the result -u,--strip-underscore Strip a leading underscore from single-token strings C++ language: -k,--keep=CHARS Allow CHARS in single-token strings, keep the result -i,--ignore=CHARS Allow CHARS in single-token strings, toss the result -u,--strip-underscore Strip a leading underscore from single-token strings Java language: -k,--keep=CHARS Allow CHARS in single-token strings, keep the result -i,--ignore=CHARS Allow CHARS in single-token strings, toss the result -u,--strip-underscore Strip a leading underscore from single-token strings Assembly language: -c,--comment=CHARS Any of CHARS starts a comment until end-of-line -k,--keep=CHARS Allow CHARS in tokens, and keep the result -i,--ignore=CHARS Allow CHARS in tokens, and toss the result -u,--strip-underscore Strip a leading underscore from tokens -n,--no-cpp Don't handle C pre-processor directives Text language: -i,--include=CHAR-CLASS Treat characters of CHAR-CLASS as token constituents -x,--exclude=CHAR-CLASS Treat characters of CHAR-CLASS as token delimiters Perl language: -i,--include=CHAR-CLASS Treat characters of CHAR-CLASS as token constituents -x,--exclude=CHAR-CLASS Treat characters of CHAR-CLASS as token delimiters -d,--dtags Include documentation tags Lisp language: REPORTING BUGS
Report bugs to bug-idutils@gnu.org xtokid - 4.5 August 2012 XTOKID(1)
All times are GMT -4. The time now is 03:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy