Sponsored Content
Top Forums Shell Programming and Scripting If condition giving syntax error. Need help. Post 302951422 by Scrutinizer on Thursday 6th of August 2015 05:31:20 AM
Old 08-06-2015
remove the inner single brackets:
Code:
if [[ ${Input_parameters[0]} = "-h" || ${Input_parameters[0]} = "--help"  ||  ${No_of_input_params} -lt 0 ]]

Note that the single = is ksh 88 syntax. Bash / ksh93 and zsh require a double == . Also, number of input parameters less than zero?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

/dev/rStp0 giving error

I do my backups using the following command find / -print |cpio -ocv >/dve/rStp0 It has been working fine for ages and suddenly I am getting this error :- Reached end of medium on output If you want to go on type device/file name when ready This happens after you press enter when... (1 Reply)
Discussion started by: workingstiff
1 Replies

2. UNIX for Advanced & Expert Users

script giving error

Hi All, i have an small issue... echo " " eval x=$@ export x=`echo $x` echo $x ssh user@ipadrss; cd /mbbv/home/; cd /mbbv/home/orange/orange/ echo pwd bash samplescript.sh $x above is my script which will triger from server A and will connect to server B for some... (2 Replies)
Discussion started by: Shahul
2 Replies

3. BSD

Xarchiver giving error messages

I have FreeBSD installed with Xarchiver and when extracting files through the file manager ("Extract here..." option) the following error pops up: tar: unrecognized option `--overwrite' Perhaps this is a known error and is there a way to solve it? (10 Replies)
Discussion started by: figaro
10 Replies

4. Solaris

useradd giving error in solaris 10

Hi, I have installed Solaris 10 in my PC and now installing Oracle10, but while adding a user i am getting following error: useradd -g oinstall -G dba -d /export/home/oracle oracle UX: useradd: ERROR: Inconsistent password files. See pwconv(1M). I have tried pwconv command,... (4 Replies)
Discussion started by: amitanshu.verma
4 Replies

5. Shell Programming and Scripting

bc giving error: (standard_in) 2: parse error

Below part of script, is working fine sometimes and gives error sometime. I am doing float operations, checking if x > y. ##########CODE########## THRESHOLD="1.25" ratio=$( echo "scale=2; ${prev}/${current}" | bc ) if ; then split_date=`echo ${line} | cut -d, -f2` fi ... (9 Replies)
Discussion started by: manishma71
9 Replies

6. Shell Programming and Scripting

set -o vi giving set: Syntax error

when trying : set -o vi getting error like- : set: Syntax error help me Double post (of sorts). Continue here. (0 Replies)
Discussion started by: RahulJoshi
0 Replies

7. Shell Programming and Scripting

Help with IF Condition Syntax

Hi. I expect the following unix script command to return 8: ls -ltr dropez* | grep -c dropez I can't seem to find the correct syntax (borne shell), can anyone help be to write an IF condition something like this: IF (ls -ltr dropez* | grep -c dropez) = 8 THEN ...do stuff ELSE ...do... (4 Replies)
Discussion started by: buechler66
4 Replies

8. Shell Programming and Scripting

syntax of if condition in ksh is wrong

The syntax of 'if' conditionals in bash and ksh seems different. I am trying to check for a particular version using 'if' in ksh. This very simple syntax gives syntax error. I have tried many variants, but no go. Please correct the syntax. Later I will expand it to 'if' and 'else'. #!/bin/ksh... (8 Replies)
Discussion started by: nivedhitha
8 Replies

9. AIX

multipath giving error

Hi, # lspath Missing hdisk0 fscsi0 Missing hdisk1 fscsi0 Missing hdisk2 fscsi0 Missing hdisk3 fscsi0 Missing hdisk4 fscsi0 Missing hdisk5 fscsi0 Missing hdisk6 fscsi0 Missing hdisk7 fscsi0 Missing hdisk8 fscsi0 Missing hdisk9 fscsi0 Missing hdisk10 fscsi0 Missing hdisk11... (2 Replies)
Discussion started by: JATA01
2 Replies

10. HP-UX

HP-UX: Shell Script giving " 0^J30: Syntax error"

Hi All, We are getting a very unique error while running a shell script on HP-UX box. Can somebody help in this regards? The shell script is working fine on linux/solaris box. Error: ++++++++++++++++++++++++ $/test.sh ./test.sh: 0^J30: Syntax error $ ++++++++++++++++++++++++ TIA.... (16 Replies)
Discussion started by: vai_sh
16 Replies
WAIT_EVENT_INTERRUPT(9) 					   Driver Basics					   WAIT_EVENT_INTERRUPT(9)

NAME
wait_event_interruptible_exclusive_locked_irq - sleep until a condition gets true SYNOPSIS
wait_event_interruptible_exclusive_locked_irq(wq, condition); ARGUMENTS
wq the waitqueue to wait on condition a C expression for the event to wait for DESCRIPTION
The process is put to sleep (TASK_INTERRUPTIBLE) until the condition evaluates to true or a signal is received. The condition is checked each time the waitqueue wq is woken up. It must be called with wq.lock being held. This spinlock is unlocked while sleeping but condition testing is done while lock is held and when this macro exits the lock is held. The lock is locked/unlocked using spin_lock_irq/spin_unlock_irq functions which must match the way they are locked/unlocked outside of this macro. The process is put on the wait queue with an WQ_FLAG_EXCLUSIVE flag set thus when other process waits process on the list if this process is awaken further processes are not considered. wake_up_locked has to be called after changing any variable that could change the result of the wait condition. The function will return -ERESTARTSYS if it was interrupted by a signal and 0 if condition evaluated to true. COPYRIGHT
Kernel Hackers Manual 3.10 June 2014 WAIT_EVENT_INTERRUPT(9)
All times are GMT -4. The time now is 08:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy