How to write an OR statement


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to write an OR statement
# 1  
Old 11-08-2005
How to write an OR statement

Hi all,
I want to check if the first or the second or the third argument of call to a shell script is empty.

How do i do that in a short way. I watched some examples and i believe
if [ .$1 = . ] checks if an argument is NULL.

If so, how can i add the checks for argument 2 and 3 in the statement?

Thanks in advance
Auke Quist
# 2  
Old 11-08-2005
if [ .$1 = . ] || [ .$2 = . ] || [ .$3 = . ] ; then
echo "missing parameter"
fi
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Is it possible to write write multiple cronjobs in shellscript??

Hi All, I need the answer of below question? 1) How to write multiple cronjobs in shellscript? Is there any way or we cant write in shellscript... Regards, Priyanka (2 Replies)
Discussion started by: pspriyanka
2 Replies

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

3. Shell Programming and Scripting

Awk/sed problem to write Db insertion statement

Hi There, I am trying to load data from a csv file into a DB during our DB migration phase. I am successfully able export all data into a .csv file but those have to rewritten in terms insert statement which will allow for further population of same data in different DB My exiting csv record... (6 Replies)
Discussion started by: bhaskar_m
6 Replies

4. Shell Programming and Scripting

Need a clue to write a IF statement

Hi all, i am writing a shell script in which i got stuck when tried to use a if statement. This is my code : #!/bin/sh today=`date +"%a %b %e"` find /prod/logs -name '*.log' -mtime 0 -exec cp {} /home/hzjnr0/test \; find /home/hzjnr0/test -type f -exec grep -i "successfully" {} \; >... (6 Replies)
Discussion started by: Soma Das
6 Replies

5. Shell Programming and Scripting

How to write If statement using && and operator in Unix

Hi What is the syntax for if statement using && and || operator? if && ] || here its giving me an error to this if statement any suggestion?? (2 Replies)
Discussion started by: Avi
2 Replies

6. IP Networking

read/write,write/write lock with smbclient fails

Hi, We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies

7. Shell Programming and Scripting

Find all files with group read OR group write OR user write permission

I need to find all the files that have group Read or Write permission or files that have user write permission. This is what I have so far: find . -exec ls -l {} \; | awk '/-...rw..w./ {print $1 " " $3 " " $4 " " $9}' It shows me all files where group read = true, group write = true... (5 Replies)
Discussion started by: shunter63
5 Replies

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

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

10. Shell Programming and Scripting

write statement into one file

I have one file name start.sh in rinku directory. I want to move it to rinku1 directory. I also mantain log file. In the log file I want to write the the statement whenever the move is failed. Example: >echo `mv /rinku/me.tx ../rinku1` | tee -a log1 mv: me.tx: cannot access: No such file or... (5 Replies)
Discussion started by: rinku
5 Replies
Login or Register to Ask a Question