Sponsored Content
Top Forums Shell Programming and Scripting multiple conditions in if statements Post 20262 by tim mauger on Tuesday 23rd of April 2002 05:33:19 PM
Old 04-23-2002
Question multiple conditions in if statements

Hi all, I'm confused about the proper syntax for multi-conditional if then statements. I'm trying to set limitations on info input on the command line.. i.e.

if [$x=[+|-|/|*|%]] ;then
$x=$vr1
else
print "You have entered an invalid option."

Can someone please clue me in on what is wrong with my syntax; what teh correct syntax is for using "and" "or" in similar statements.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

multiple 'if' statements out of array

I want to do multiple comparisons on a series of numbers from an array: I send the numbers in file1 through want to print out some info from file2 based on some conditions. The syntax just isn't correct??? awk ' NR==FNR{ a=$0 next ... (2 Replies)
Discussion started by: dcfargo
2 Replies

2. Shell Programming and Scripting

if then statements with two conditions...?

Is it possible to setup two conditions for an if then statement in a pbash script? For example, depending on the text value of a variable I parse out of an xml file, I want to assign it a numerical values. Example: if ; then VAR="25" fi if ; then VAR="25" fi Can these two... (3 Replies)
Discussion started by: audiophile
3 Replies

3. Shell Programming and Scripting

Help regarding multiple conditions

Hi All, I am new to shell scripting. Can any one say what is wrong in this if statement, that uses multiple conditions if then *************** else if ( -z $pcs && "$night_time_calc" > "$night_time" ) then ******************************** ... (4 Replies)
Discussion started by: ssenthilkumar
4 Replies

4. Shell Programming and Scripting

How do I execute multiple statements within If then else

Please help me. I have been doing this for several hours. Here is the code if then echo a b c d >> file.txt echo 1111 >> file.txt fi The reason I want the two echo is because I want these statements printed on multiple lines. I keep getting error . First it tells me... (2 Replies)
Discussion started by: asemota
2 Replies

5. Shell Programming and Scripting

Running multiple if statements

Hi, Hav automated a process, and it is working fine. for first process alone status = ` ps -ef |grep a ` if then echo " Success" > temp/logfile else echo " Failure" > temp/logfile fi Now I hav to write script to automated some 2 process and then send mail using cron.. ... (5 Replies)
Discussion started by: NehaKrish
5 Replies

6. Shell Programming and Scripting

execute multiple statements in if-else

how can we execute multiple statements in else condition i have if then statement else statements fi in else condition i have multiple statements but it executing only one statement is there any way to execute multiple statements (4 Replies)
Discussion started by: nani1984
4 Replies

7. Shell Programming and Scripting

Multiple if Statements

Hi All, I need to check for 3 conditions and if all the 3 are not satified need to say that services are not running.... is the below code correct. #********** Check to see if Service 1 is still running************** if then echo "$datetimestamp: Service1 is not running" >>... (4 Replies)
Discussion started by: ch33ry
4 Replies

8. Shell Programming and Scripting

Multiple while statements?

I'm working on a script for class as a final project. We have to ask for values (city, state, zip) five times, but the state can only be MI, IN, IL, or OH. I'm trying to do this with a while loop inside of a while loop, but I have no idea how to do it properly. Here's what I have so far: ... (3 Replies)
Discussion started by: nickzourdos
3 Replies

9. UNIX for Dummies Questions & Answers

Multiple if statements

exmaple: file1 and file2 has 1 bit if then exit else send out email fi if then exit else send out email fi it exits the 1st if. did not continue with my 2nd if. thanks in advanced. Please use CODE tags are suggested on every page when you post an item in... (7 Replies)
Discussion started by: lawsongeek
7 Replies

10. Shell Programming and Scripting

Using multiple 'for' statements

Hello, I am new to scripting and I am trying to write a simple script that creates users and adds their passwords from two files; one a user list file and another a password list file. For example, I have two files already. $ cat file1 andy stephane aby paul $ cat file2 123 234... (4 Replies)
Discussion started by: FemoTheDon
4 Replies
CONVICKT(1)						      General Commands Manual						       CONVICKT(1)

NAME
convickt - convert INTERCAL files between formats SYNOPSIS
convickt incharset outcharset [paddingrule [arrayname]] DESCRIPTION
This manual page describes the convickt command. Fuller documentation is available via the command info convickt convickt converts INTERCAL programs from one character set to another; it takes input from standard input and sends its output to standard output. OPTIONS
For incharset and outcharset atari Interpret the input as being ASCII-7 Atari syntax INTERCAL, as is used by the Atari INTERCAL-72 compiler, J-INTERCAL, and C-INTERCAL default syntax, or output in that syntax. baudot Interpret the input as being in CLC-INTERCAL's extended Baudot syntax, or output in that syntax. ebcdic Interpret the input as being in the CLC-INTERCAL dialect of EBCDIC, or output in that syntax. latin1 Interpret the input as being Latin-1 Princeton syntax INTERCAL, as is used by default by CLC-INTERCAL and also readable by C-INTER- CAL with the -X switch, or output in that syntax. For paddingrule zero Pad the irrelevant bits in ASCII-7 and Baudot output with zeros. printable Set the values of the irrelevant bits in ASCII-7 and Baudot output to try to cause the output to stay within character range 32-126. This option is the default. (Note that paddingrule is irrelevant for 8-bit character sets like Latin-1 and EBCDIC). random Pad the irrelevant bits in ASCII-7 and Baudot output with random data, except that outputing an all-bits-zero octet is avoided. CAVEATS
Not all conversions are possible, due to the character sets having different characters available. In most cases, an unconvertible or invalid character will be converted to a 0 (padded appropriately); the exception is that if a tab cannot be converted, it will instead be converted to a single space (so that INTERCAL programs still run if converted to Baudot). Using atari as an input or output character set will literally convert characters which differ between Atari and Princeton syntax without checking to see whether they are being used as operators or not. If arrayname is given, then instead of outputting the converted text literally, it will be output as portable (that is, legal in INTER- CAL-72, C-INTERCAL, J-INTERCAL and CLC-INTERCAL) INTERCAL that dimensions the tail array given as arrayname and assigns each byte of the output to an element of that array; this is mostly useful for producing Baudot text for CLC-INTERCAL-style array IO. AUTHOR
convickt and this manual page were written by Alex Smith. CONVICKT(1)
All times are GMT -4. The time now is 04:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy