Sponsored Content
Top Forums Shell Programming and Scripting using case to do this might be a bad idea? Post 302113485 by Perderabo on Friday 6th of April 2007 11:33:09 AM
Old 04-06-2007
To debug it try:
Code:
echo oflag = $oflag
case ${oflag} in 
o)
       TYPEO="Orders"
       ;;
*)
       TYPEO=""
       ;;
esac
echo TYPEO = $TYPEO

You will find that oflag was not set to "o" if TYPEO is getting set to "".
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

lower case to upper case string conversion in shell script

How can convert a Lower case variable value to an upper case in the kron shell script. (3 Replies)
Discussion started by: dchalavadi
3 Replies

2. Shell Programming and Scripting

Limitations of awk? Good idea? Bad idea?

Keeping in mind that I'm relatively comfortable with programming in general but very new to unix and korn/bourne shell scripts.. I'm using awk on a CSV file, and then performing calculations and operations on specific fields within specific records. The CSV file I'm working with has about 600... (2 Replies)
Discussion started by: yongho
2 Replies

3. UNIX for Dummies Questions & Answers

Why is it Bad Idea to insert "." (Dot) to PATH ?

I was told that it's a Bad Idea (especially for root ) to Add To the Variable $PATH in unix the ":." (dot), In order to execute programs in my current directory without typing ./program For example: PATH=$PATH:$HOME/bin:. Does someone know why is it a Bad Idea? (2 Replies)
Discussion started by: amitbern
2 Replies

4. Shell Programming and Scripting

Script needed to select and delete lower case and mixed case records

HELLO ALL, URGENTLY NEEDED A SCRIPT TO SELECT AND DELETE LOWER AND MIXED CASE RECORDS FROM A COLUMN IN A TABLE. FOR EXAMPLE : Table name is EMPLOYEE and the column name is CITY and the CITY column records will be: Newyork washington ... (1 Reply)
Discussion started by: abhilash mn
1 Replies

5. Shell Programming and Scripting

case loop... repeat on bad input?

I'm trying to get a case statement to start over if an undefined option is selected... But I am ata loss on how to actually do it. Here is a quick example of what I have. Echo "1) do this/n 2) Do that/n 3) Quit/n Make a selection/n" Read answer Case answer in 1) Dothid;; 2) Dothat;;... (3 Replies)
Discussion started by: trey85stang
3 Replies

6. OS X (Apple)

Deleting a recursive symbolic link was a very bad idea

Well i was tidying up some files in a very important directory on our development server and somehow some plank had put a recursive sybmolic link in it. Which I the even bigger plank tried to delete from my FTP client. My FTP client then thought it would be OK to delete not only the sybmolic link... (0 Replies)
Discussion started by: timgolding
0 Replies

7. Red Hat

Is overlapping two RAID5 arrays on same drives a bad idea ??

is placing two RAID5 arrays on disk as shown below Is advisable? Will this create performance problems? sda-(500GB) sdb-(1TB) sdc-(1TB) sdd-(1TB) (250MB)----------(250MB) ---------unused------------unused------->(/dev/md0) RAID1 ... (6 Replies)
Discussion started by: Saed
6 Replies

8. Shell Programming and Scripting

Why I get bad bad substitution when using eval?

Why I get bad replace when using eval? $ map0=( "0" "0000" "0") $ i=0 $ eval echo \${map$i} 0000 $ a=`eval echo \${map$i}` !!!error happens!!! bash: ${map$i}: bad substitution How to resolve it ? Thanks! (5 Replies)
Discussion started by: 915086731
5 Replies
sem_open(2)							System Calls Manual						       sem_open(2)

NAME
sem_open - create/open a named POSIX semaphore SYNOPSIS
DESCRIPTION
is used to open or create a named semaphore. A successful call to will create a descriptor for the semaphore specified by name. The pointer to the semaphore returned by can be used to access the semaphore associated with name in subsequent operations. The name argument points to a string referring to a semaphore. It should begin with a "/" and shall conform to pathname rules except that no path component should be "." or "..". The oflag argument specifies whether a semaphore is to be created or not. The following bits in it may be set: If this flag is set, a new semaphore is created if it does not already exist. If this flag is not set, the semaphore should already exist. If this flag is set, the call fails if the semaphore already exists. This flag is valid only when is also set; otherwise, it is ignored. The mode and value arguments are provided to supply the permissions and the initial value information necessary for creating a new sema- phore. To use this function, link in the realtime library by specifying on the compiler or linker command line. EXAMPLES
The following call to will create a new named semaphore if one does not exist, which depends on the flags specified in oflag, has the per- missions specified in mode and has an initial value of value. RETURN VALUE
If the semaphore was created and initialized, returns a pointer to a structure containing the index of the new descriptor. If the semaphore could not be created/initialized, the call returns -1 and sets to indicate the error. If the named semaphore is already opened by the calling process, a descriptor and a structure for the named semaphore already exists for the calling process. A new descrip- tor is not created and a pointer to the existing structure is returned for this call. ERRORS
fails and does not perform the requested operation if any of the following conditions are encountered: [EACCES] The named semaphore exists and the process does not have the permissions to open the semaphore as described by oflag, or the named semaphore does not exist and the process does not have the permission to open it. [EEXIST] The flags and are set in oflag and the named semaphore exists. [EINTR] A signal interrupted the operation. [EINVAL] The argument value is greater than and the flag was specified in oflag. [EINVAL] The name argument does not begin with "/" or contains "." or ".." as a pathname component. [EMFILE] Too many semaphore descriptors are currently in use by this process. [ENAMETOOLONG] The name string is longer than [ENFILE] There are too many semaphores in the system. [ENOENT] The flag is not set in oflag and the named semaphore does not exist. [ENOSPC] There are insufficient resources for the creation of a new named semaphore. SEE ALSO
sem_close(2), sem_post(2), sem_wait(2), sem_unlink(2), privileges(5), <semaphore.h>. STANDARDS CONFORMANCE
sem_open(2)
All times are GMT -4. The time now is 04:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy