Sponsored Content
Full Discussion: If statement advice
Top Forums Shell Programming and Scripting If statement advice Post 302880074 by in2nix4life on Tuesday 17th of December 2013 10:21:54 AM
Old 12-17-2013
Try using -z in your if statement to check for a null value in a variable:

Code:
if [ -z $VARIABLE ]

This User Gave Thanks to in2nix4life For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

Looking for some advice

I am looking for some advice on wether to use unix or red hat linux? I have played with most windows OS and Mac OS up to in and including OS X. any and all advice would be appreciated (4 Replies)
Discussion started by: justawind
4 Replies

2. Shell Programming and Scripting

looking for advice...

Hi. First of all, Im an msoft guy, and when it comes to linux/unix, I'm retarded. Here is what I'm trying to do. I want to start I want to automatically connect to a remote server. Then I need it to login(https) -insert the licensce in the box(vi) -based on that licensce, the... (1 Reply)
Discussion started by: bravo24601
1 Replies

3. Shell Programming and Scripting

Script Help/Advice

Alright, I feel like I have a pretty good basic knowledge of shell scripting, but this one is throwing me for a loop. I know I've seen something similar done with awk, but I couldn't find it with the search function. I've grepped through my log file and get results like this: --... (14 Replies)
Discussion started by: earnstaf
14 Replies

4. UNIX for Dummies Questions & Answers

need advice

i am currently running windows vista home premium, i want to install unix because i just started a computer programing course, i am just wondering if i install unix will i still have vista?? how does it work? will i get a choice of which os to run on system startup?? (1 Reply)
Discussion started by: naner9
1 Replies

5. Red Hat

Any advice would help

Hi everyone. I must admit up front that I am not very strong when it comes to Linux. I am actually a Windows guy, but don't let that count against me. :) I work for a very small company so we do not have a Server/Linux Admin on staff. Most of our needs have been handled by our WebHost. We have... (2 Replies)
Discussion started by: liquidstyleb
2 Replies

6. 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

7. 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

8. AIX

Need career advice please

Hi all, I'm a Solaris/linux sysadmin with a good general UNIX skills and with a little tiny background on AIX with no exposure to IBM's hardware ( just reading ) , but i think i can cope with it . UNIX jobs nowadays are rare here ( i mean hp-ux , solaris , aix ) not linux specially after the... (6 Replies)
Discussion started by: h@foorsa.biz
6 Replies

9. Shell Programming and Scripting

Need Advice

Guys, Can you tell me what value would additional knowledge of PERL and CGI scripting will add to my skill set of UNIX shell scripting and ORACLE PL/SQL? I understand that PERL is a good tool for text processing. (1 Reply)
Discussion started by: yabhi_22
1 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
directio(3C)						   Standard C Library Functions 					      directio(3C)

NAME
directio - provide advice to file system SYNOPSIS
#include <sys/types.h> #include <sys/fcntl.h> int directio(int fildes, int advice); DESCRIPTION
The directio() function provides advice to the system about the expected behavior of the application when accessing the data in the file associated with the open file descriptor fildes. The system uses this information to help optimize accesses to the file's data. The directio() function has no effect on the semantics of the other operations on the data, though it may affect the performance of other operations. The advice argument is kept per file; the last caller of directio() sets the advice for all applications using the file associated with fildes. Values for advice are defined in <sys/fcntl.h>. DIRECTIO_OFF Applications get the default system behavior when accessing file data. When an application reads data from a file, the data is first cached in system memory and then copied into the applica- tion's buffer (see read(2)). If the system detects that the application is reading sequentially from a file, the system will asynchronously "read ahead" from the file into system memory so the data is immediately available for the next read(2) operation. When an application writes data into a file, the data is first cached in system memory and is written to the device at a later time (see write(2)). When possible, the system increases the performance of write(2) operations by cacheing the data in memory pages. The data is copied into system memory and the write(2) operation returns immediately to the application. The data is later written asynchronously to the device. When possible, the cached data is "clustered" into large chunks and written to the device in a single write operation. The system behavior for DIRECTIO_OFF can change without notice. DIRECTIO_ON The system behaves as though the application is not going to reuse the file data in the near future. In other words, the file data is not cached in the system's memory pages. When possible, data is read or written directly between the application's memory and the device when the data is accessed with read(2) and write(2) operations. When such transfers are not possible, the system switches back to the default behav- ior, but just for that operation. In general, the transfer is possible when the application's buffer is aligned on a two- byte (short) boundary, the offset into the file is on a device sector boundary, and the size of the operation is a multiple of device sectors. This advisory is ignored while the file associated with fildes is mapped (see mmap(2)). The system behavior for DIRECTIO_ON can change without notice. RETURN VALUES
Upon successful completion, directio() returns 0. Otherwise, it returns -1 and sets errno to indicate the error. ERRORS
The directio() function will fail if: EBADF The fildes argument is not a valid open file descriptor. ENOTTY The fildes argument is not associated with a file system that accepts advisory functions. EINVAL The value in advice is invalid. USAGE
Small sequential I/O generally performs best with DIRECTIO_OFF. Large sequential I/O generally performs best with DIRECTIO_ON, except when a file is sparse or is being extended and is opened with O_SYNC or O_DSYNC (see open(2)). The directio() function is supported for the NFS and UFS file system types (see fstyp(1M)). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
fstyp(1M), mmap(2), open(2), read(2), write(2), fcntl.h(3HEAD), attributes(5) WARNINGS
Switching between DIRECTIO_OFF and DIRECTIO_ON can slow the system because each switch to DIRECTIO_ON might entail flushing the file's data from the system's memory. SunOS 5.10 9 Apr 2003 directio(3C)
All times are GMT -4. The time now is 07:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy