Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Create a condition for a non-included string Post 302598212 by h0ujun on Monday 13th of February 2012 08:21:33 PM
Old 02-13-2012
Create a condition for a non-included string

hey,

just want to ask how to check this scenario

Code:
a="apple banana cherry"
if [ a does not contain egg ]
    egg=0
fi

how do you do the condition?

thanks!
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to create folder wen the condition satisfied

hi i hav files ha1j ha2m ha3n ha4q ha5s ...like tat im having some 20 files ..and i want to create a folder as the same amount of files which im having wen the condition if loop is satisfied .. thank you (5 Replies)
Discussion started by: maximas
5 Replies

2. Shell Programming and Scripting

How to split the String based on condition?

hi , I have a String str="/opt/ibm/lotus/ibw/latest" or ="/opt/lotus/ibw/latest" this value is dynamic..I want to split this string into 2 strings 1. /opt/ibm/lotus(/opt/lotus) this string must ends with "lotus" 2./ibw/latest can any body help me on this? Regards, sankar (2 Replies)
Discussion started by: sankar reddy
2 Replies

3. Shell Programming and Scripting

create separate file after checking condition..

Problem : I want to create a separate file for country list if condition is true. Please help. ***************************************************** Input file: SV-INCR-139302-365540488-201104090934.sqllog SV-INCR-1082-552793184-201104040805.sqllog SV-INCR-1077-855045741-201104040805.sqllog... (4 Replies)
Discussion started by: humaemo
4 Replies

4. Shell Programming and Scripting

Error in if condition string comparison

Hello all! I need help in debugging following script. I have no idea where I am going wrong. #!/bin/bash for p1 in A1 TM MP do for p2 in A1 TM MP do for mp1 in N1 N2 do for mp2 in N1 N2 do for mp3 in N1 N2 do for mp4 in N1 N2 do for... (7 Replies)
Discussion started by: RLOA
7 Replies

5. Shell Programming and Scripting

String comparison in if condition

I have written a condition if && where i am comparing the hour value with 00, can i do that, as i am checking if the hour value in the date is not equal to 00 and then diplaying the time as p.m else in a.m. Please tell me if i can compare $hour with 00. Is that correct or an error? (2 Replies)
Discussion started by: sharmistha
2 Replies

6. UNIX for Dummies Questions & Answers

Bash condition test at the end of string

I want to check (using bash condition test function) if string contains three spaces, ignoring last three spaces at the end of string. string_to_report='foo bar foo bar ' string_to_ignore='foo bar ' (8 Replies)
Discussion started by: useretail
8 Replies

7. UNIX for Dummies Questions & Answers

Create a file on UNIX with multiple columns on certain condition

I need to write the list of files to a new file in one column , the second column would contain the first line of that file (header record extracted through head -1 ) and the third column would contain the last record of that file (trailer record tail -1 ) . Example :- folder where the files... (8 Replies)
Discussion started by: IshuGupta
8 Replies

8. Shell Programming and Scripting

Create Dynamic if condition

Create Dynamic If condition Hi, I have a file color.txt which has data as shown below Red Blue Green Yellow White Pink Black Based on a variable I execute a tail command as shown below tail -${LEFT_OVR} color.txt LEFT_OVR can be any number less than count of number of lines in a... (7 Replies)
Discussion started by: wahi80
7 Replies

9. UNIX for Advanced & Expert Users

How to create folder by using if and elif condition?

Hi All, I have already code to create folder for one country let say US , now we want to create folder/directory for JP country also using shell script , application server. $COUNTRY='US' if ] then if mkdir -m 777 -p /opt/TEST/$COUNTRY/$INVOICE >/dev/null 2>&1 | tee -a ... (5 Replies)
Discussion started by: Boost
5 Replies
TRACEBACK(1)							   User Commands						      TRACEBACK(1)

NAME
Traceback - sends an OSC message SYNOPSIS
osc-send [options] [url] osc-address [,typetags] [osc arguments] DESCRIPTION
Traceback (most recent call last): File "./scripts/osc-send", line 11, in <module> import txosc # for __version__ ImportError: No module named txosc File "./scripts/osc-send", line 11, in <module> import txosc # for __version__ ImportError: No module named txosc EXAMPLES
The following examples are equivalent: osc-send osc.tcp://127.0.0.1:17779 /ham/spam ,sif egg 2 3.14159 osc-send --tcp --host=127.0.0.1 --port=17779 --type-tags=sif /ham/spam egg 2 3.14159 osc-send -T -P 17779 /ham/spam egg 2 3.14159 OSC MESSAGES
An OSC message consists of an OSC Address Pattern followed by an OSC Type Tag String followed by zero or more OSC Arguments. OSC ADDRESSES
An OSC Address Pattern is a string beginning with the character '/' (forward slash). It is mandatory to provide one. OSC TYPE TAGS
An OSC Type Tag String is a string (beginning with the character ',' (comma)) followed by a sequence of characters corresponding exactly to the sequence of OSC Arguments in the given message. Each character after the comma is called an OSC Type Tag and represents the type of the corresponding OSC Argument. Here is the list of supported type tags: i - 32bit integer h - 64bit integer f - 32bit floating point number d - 64bit (double) floating point number s - string S - symbol c - char m - 4 byte midi packet (8 digits hexadecimal) T - TRUE F - FALSE N - NIL I - INFINITUM VALUES
Values are space separated. Quoting strings might be handy. The full Open Sound Control specification can be found at http://opensoundcontrol.org/specification HISTORY
Written by Arjan Scherpenisse and Alexandre Quessy in 2010. Traceback (most recent call last): October 2010 TRACEBACK(1)
All times are GMT -4. The time now is 09:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy