Sponsored Content
Full Discussion: Problems with if condition
Top Forums Shell Programming and Scripting Problems with if condition Post 302905188 by joeyg on Tuesday 10th of June 2014 07:29:49 AM
Old 06-10-2014
grep?

Why not grep for $input in $server?

Code:
$ server="ix1 ix2 bx1 bx2"

$ echo $server
ix1 ix2 bx1 bx2

$ var1="ix1"

$ echo $var1
ix1

$ echo $server | grep $var1
ix1 ix2 bx1 bx2

$ var1="ix3"

$ echo $server | grep $var1

$


Last edited by joeyg; 06-10-2014 at 08:34 AM.. Reason: added example
This User Gave Thanks to joeyg For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

'make' problems (compliation problems?)

I'm trying to compile and install both most recent version of 'make' and the most recent version of 'openssh' on my Sparc20. I've run into the following problems... and I don't know what they mean. Can someone please help me resolve these issues? I'm using the 'make' version that was... (5 Replies)
Discussion started by: xyyz
5 Replies

2. UNIX for Dummies Questions & Answers

help with if condition

Does anybody know when the following if condition is true (ie. what it means) if ($1 ~ "^") thnx :) rkap (2 Replies)
Discussion started by: rkap
2 Replies

3. UNIX for Dummies Questions & Answers

if condition

suppose a name is read how to check whether the name contains only alphabets and space not non-alphabetic characters and special characters (5 Replies)
Discussion started by: manisha_agrawal
5 Replies

4. Shell Programming and Scripting

if condition ...

i have following if condition if above statement is case sensitive.....what is syntax if i have to make above comparision case insensetive (4 Replies)
Discussion started by: mahabunta
4 Replies

5. Shell Programming and Scripting

if condition

Hi how to write this: if then usage fi thx (3 Replies)
Discussion started by: melanie_pfefer
3 Replies

6. HP-UX

Difference between [condition] and [[condition]] and ((condition)) when used with if condition

Executed the following if conditions .. and got different results . only (( )) gave correct o/p with all scenarios . Can anybody please let me know what is the difference between and ] and ((condition)) when used with if condition. And why each condition gave different result. 1.... (2 Replies)
Discussion started by: soumyabubun
2 Replies

7. Shell Programming and Scripting

If condition

Hi All, I am using the below if command to comparing two variables but is condition is true but going in else part. ################# if ; then TAKE_SNAPS echo "Snaps updates done" UPDATE_DS_SNAPS_TAKEN else echo "Seemes DS & JDP is still running KIndly... (4 Replies)
Discussion started by: ajaincv
4 Replies

8. Shell Programming and Scripting

redirect stdout echo command in condition A run in condition B

hi, I have some problems in my simple script about the redirect echo stdout command inside a condition. Why is the echo command inside the elif still execute in the else command Here are my simple script After check on the two diff output the echo stdout redirect is present in two diff... (3 Replies)
Discussion started by: jao_madn
3 Replies

9. Shell Programming and Scripting

if condition

if chr1:109457160 1 109457160 99.1735537190083 + chr1:109457233 1 109457233 99.1735537190083 - chr1:109457614 1 109457614 99.1735537190083 + chr1:109457618 1 109457618 100 + chr1:109457943 1 109457943 100 - chr1:109458224 1 109458224 99.1735537190083 - file1.txt If 6th column in... (3 Replies)
Discussion started by: johnkim0806
3 Replies

10. Shell Programming and Scripting

If condition return 0 even when it fails to satisfy te condition

HI My doubt may be basic one but I need to get it clarified.. When i use "if" condition that checks for many AND, OR logical conditions like if ]; then return 0 fi Even the if condition fails it returns as zero.. Any clue.. But if i add else condition like if ]; ... (2 Replies)
Discussion started by: Priya Amaresh
2 Replies
PLOT(3F)																  PLOT(3F)

NAME
plot: openpl et al. - f77 library interface to plot(3X) libraries. SYNOPSIS
subroutine openpl() subroutine erase() subroutine label(str) character str*(*) subroutine line(ix1, iy1, ix2, iy2) subroutine box(ix1, iy1, ix2, iy2) Draw a rectangle and leave the cursor at ( ix2,iy2). subroutine circle(ix, iy, ir) subroutine arc(ix, iy, ix0, iy0, ix1, iy1) subroutine move(ix, iy) subroutine cont(ix, iy) subroutine point(ix, iy) subroutine linemd(str) character str*(*) subroutine space(ix0, iy0, ix1, iy1) subroutine clospl() DESCRIPTION
These are interface subroutines, in the library -lf77plot, allowing f77 users to call the plot(3X) graphics routines which generate graphic output in a relatively device-independent manner. The f77 subroutine names are the same as the C function names except that linemod and closepl have been shortened to linemd and clospl . See plot(5) and plot(3X) for a description of their effect. Only the first 255 character in string arguments to label and linemd are used. This library must be specified in the f77(1) command before the device specific graphics library; for example, to compile and load a FOR- TRAN program in prog.f to run on a Tektronix 4014 terminal: f77 prog.f -lf77plot -l4014 See plot(3X) for a complete list of device specific plotting libraries. SEE ALSO
plot(5), plot(1G), plot(3X), graph(1G) 4.3 Berkeley Distribution April 30, 1986 PLOT(3F)
All times are GMT -4. The time now is 10:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy