Sponsored Content
Full Discussion: IF statement
Top Forums Shell Programming and Scripting IF statement Post 35595 by omran on Monday 21st of April 2003 05:00:04 AM
Old 04-21-2003
only to complete this
i made something like this

ls $POSITIVE* 2>/dev/null
if [ $? = 0 ]
then
//code
else
//code
fi

thanx again
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

If statement

Hi, I have a statement in shell script which i am writing below: if ] then ..... What is the meaning of -a option in files, meaning of the statement in the if condition ] means. Thanks (3 Replies)
Discussion started by: dreams5617
3 Replies

2. Shell Programming and Scripting

if statement

can someone please tell me what is wrong with the below. i'm trying to get a script to run if the content of a variable is either small letter y or capital letter Y. if then whatever fi (4 Replies)
Discussion started by: Terrible
4 Replies

3. Shell Programming and Scripting

statement

I want to write a program that would convert yard to feet and feet to yard. i.e 1 yard = 3 * feet Echo "enter a" read a expr a *3 The trick is that I want to give the user some options. After the conversion from yard to feet is done, I want to ask the user whether or not he/she wants to... (10 Replies)
Discussion started by: Ernst
10 Replies

4. Shell Programming and Scripting

If statement - How to write a null statement

In my ksh script, if the conditions of a if statement are true, then do nothing; otherwise, execute some commands. How do I write the "do nothing" statement in the following example? Example: if (( "$x"="1" && "$y"="a" && "$z"="happy" )) then do nothing else command command fi... (3 Replies)
Discussion started by: april
3 Replies

5. Shell Programming and Scripting

How is use sselect statement o/p in insert statement.

Hi All, I am using Unix ksh script. I need to insert values to a table using the o/p from a slelect statement. Can anybody Help! My script looks like tihs. ---`sqlplus -s username/password@SID << EOF set heading off set feedback off set pages 0 insert into ${TB_NAME}_D... (2 Replies)
Discussion started by: nkosaraju
2 Replies

6. UNIX for Dummies Questions & Answers

If statement (yes or no)

I have the program: #!/bin/ksh echo Please enter yes or no read n typeset -l n if ] then echo My name exit else echo delete my name fi Question: How can I make the program accept only the word "yes" or "no" otherwise it will ask the user to re-enter? Thanks! (7 Replies)
Discussion started by: bobo
7 Replies

7. Shell Programming and Scripting

If statement help

I'm trying to create a script that would allow me to identify the sucessful removal of a file. Here's what i put together so far, let me know if it's correct or not. FILE_NAME="cactus.dat" FILE_FIND='find / -name $FILE_NAME' if ;then echo "cactus.dat was not removed successfully" ... (3 Replies)
Discussion started by: sdpinoy
3 Replies

8. Shell Programming and Scripting

Statement

${PFILE}.backupfile Please tell me what the above statement means? (1 Reply)
Discussion started by: lg123
1 Replies

9. Shell Programming and Scripting

If statement

Hi, I have this code here. Its suppose to do something when certain condition is met, I'm pretty sure at least one of the condition will be meet somewhere in the loop but it always go to else part of the script. Is something wrong on this script? age_list=`tar -tvf /home/dir/$tarfile... (4 Replies)
Discussion started by: erin00
4 Replies

10. Shell Programming and Scripting

Convert Update statement into Insert statement in UNIX using awk, sed....

Hi folks, I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex. I have a bunch of update statements with all columns in a file which I need to convert into insert statements. UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Discussion started by: dev123
0 Replies
mbrtowc(3C)															       mbrtowc(3C)

NAME
mbrtowc() - convert a character to a wide-character code (restartable) SYNOPSIS
DESCRIPTION
If s is a null pointer, the function is equivalent to the call: In this case, the values of the arguments pwc and n are ignored. If s is not a null pointer, the function inspects at most n bytes beginning at the byte pointed to by s to determine the number of bytes needed to complete the next character (including any shift sequences). If the function determines that the next character is completed, it determines the value of the corresponding wide-character and then, if pwc is not a null pointer, stores that value in the object pointed to by pwc. If the corresponding wide-character is the null wide-character, the resulting state described is the initial conversion state. If ps is a null pointer, the function uses its own internal mbstate_t object, which is initialized at program startup to the initial con- version state. Otherwise, the mbstate_t object pointed to by ps is used to completely describe the current conversion state of the associ- ated character sequence. APPLICATION USAGE
The prototype of this function is available to applications if they are: a. conformant. b. Compiled with macro with a value >=500. c. Compiled with macro with a value >= 200112. EXTERNAL INFLUENCES
Environment Variables The behavior of this function is affected by the category of the current locale. RETURN VALUE
The function returns the first of the following that applies: 0 If the next n or fewer bytes complete the character that corresponds to the null wide-character (which is the value stored). Positive If the next n or fewer bytes complete a valid character (which is the value stored); the value returned is the number of bytes that complete the character. (size_t)-2 If the next n bytes contribute to an incomplete but potentially valid character, and all n bytes have been processed (no value is stored). When n has at least the value of the macro, this case can only occur if s points at a sequence of redundant shift sequences (for implementations with state-dependent encodings). (size_t)-1 If an encoding error occurs, in which case the next n or fewer bytes do not contribute to a complete and valid character (no value is stored). In this case, is stored in and the conversion state is undefined. ERRORS
The function may fail if: Invalid character sequence is detected. ps points to an object that contains an invalid conversion state. WARNINGS
With the exception of ASCII characters, the code values of wide characters (type of are specific to the effective locale specified by the environment variable. These values may not be compatible with values obtained by specifying other locales that are supported now, or which may be supported in the future. It is recommended that wide character constants and wide string literals (see the not be used, and that wide character code values not be stored in files or devices because future standards may dictate changes in the code value assignments of the wide characters. However, wide character constants and wide string literals corresponding to the characters of the ASCII code set can be safely used since their values are guaranteed to be the same as their ASCII code set values. AUTHOR
was developed by HP and Mitsubishi Electric Corporation. SEE ALSO
mbsinit(3C), glossary(9). mbrtowc(3C)
All times are GMT -4. The time now is 02:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy