02-01-2008
using && in if statement ..
Hi All,
Can some one tell me how to get run the following:
data1="hello"
data2="world"
if [ "$data2" != "world" && "$data1" != "hello"]
then
{
echo "good afternnon"
}
else
{
echo " good morning"
}
fi
The above code gives me an error ad below :
./if.h: line 3: [: missing `]'
Thanks in advance
Js
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Wow I'm so zoned out I don't even know if I posted this question up already (I couldn't find it in my book marks or in "yesterday's" post).
My question is, I'm writing a korn script that does something like the following, but I don't yet completely understand the syntax. I need to check that... (16 Replies)
Discussion started by: yongho
16 Replies
2. Shell Programming and Scripting
Hi, I hope the title does not scare people to look into this thread but it describes roughly what I'm trying to do. I need a solution in PHP.
I'm a programming beginner, so it might be that the approach to solve this, might be easier to solve with an other approach of someone else, so if you... (0 Replies)
Discussion started by: lowmaster
0 Replies
3. Shell Programming and Scripting
Hello All
I have a xml file with many sets of records
like this
<mytag>mydata</mytag>
<tag2>data&</tag2>
also same file can be like this
<mytag>mydata</mytag>
<tag2>data&</tag2>
<tag3>data2&data3</tag3>
Now i can grep & and replace with & for whole file but it will replace all... (4 Replies)
Discussion started by: lokaish23
4 Replies
4. Shell Programming and Scripting
Hi, I have text file abc.txt. In this file, I have the following data.
Input:
Mr Smith & Mrs Smith
Mr Smith &apos Mrs Smith
Mr Smith & Mrs Smith
Mr Smith& Mrs Smith
Mr Smith &Mrs Smith
Output:
Mr Smith & Mrs Smith
Mr Smith &apos Mrs Smith
Mr Smith & Mrs Smith
Mr Smith&... (4 Replies)
Discussion started by: naveed
4 Replies
5. Programming
Hello there,
My first time on the forums, glad to be here :)
I'm completely new to programming in PHP and I have a question which I hope someone could help me with.
I am currently using this statement:
if(($session == 2) && ($item == Dagger) && ($item2 == Dagger)){
... (5 Replies)
Discussion started by: Hero
5 Replies
6. Shell Programming and Scripting
Hi All,
The below code successfully tails the logfile.log file and colors every word "ERROR" in RED, thanks to the Perl statement below.
However, would anyone know how to append 1 additional search/replace to the Perl statement below, to color the word "SUCCESS" in GREEN (using ANSI \e
... (3 Replies)
Discussion started by: chatguy
3 Replies
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
Hi, I'm using the && operator in if statement:
if ; then
exp $UID/$PWD@$ORACLE_SID FILE=./DUMP/$TODAY$CONCAT_STR$USERNAME.dmp STATISTICS=NONE LOG=./LOG/$TODAY$CONCAT_STR$USERNAME.log
elif ; then
expdp $UID/$PWD@$ORACLE_SID DIRECTORY=./DUMP/ DUMPFILE=$TODAY$CONCAT_STR$USERNAME.dmp... (8 Replies)
Discussion started by: priya001
8 Replies
9. Shell Programming and Scripting
how do you write an if statement for something like
if ((expr 1 >= expr 2 && expr 3 >= expr 4) && expr 5 <= expr 6)
if ((TRUE && TRUE) && TRUE) then
condition...
i've done it this way but it doesn't seem to work.
if (] && "$ex_day" -le "$curr_day" ); then
condition... (3 Replies)
Discussion started by: angilulu
3 Replies
10. Shell Programming and Scripting
Hi All,
Do you have any sample script,
- auto get file from SFTP remote server and delete file in remove server after downloaded.
- only download specify filename
- auto upload file from local to SFTP remote server and delete local folder file after uploaded
- only upload specify filename
... (3 Replies)
Discussion started by: weesiong
3 Replies
LEARN ABOUT SUSE
openipmicmd
openipmicmd(1) An IPMI Command Interface openipmicmd(1)
NAME
openipmicmd - An IPMI Command Interface
SYNOPSIS
openipmicmd [-k entry-to-execute] <connection parms>
DESCRIPTION
The openipmicmd program allows a user to execute direct IPMI commands. It can work with direct interface with the OpenIPMI driver or with
IPMI LAN interfaces.
OPTIONS
-k entry-to-execute
Execute a single command an exit.
<connectionparms>
The parameters for the connection depend on the connection type. These are all described in openipmi_conparms (7)
COMMANDS
Once up, you can execute commands in the user interface. Note that commands and responses are asynchronous, you issue a command and the
interface returns immediately. When the response comes back, it will be dumped on your console. That's a little strange looking, but IPMI
is ansychronous underneath. Note that the -k option is synchronous, it will wait for the response or a timeout before returning.
0f lun netfn cmd [data1 [data2 ...]]
Send a command to the BMC you are connected to.
channel [ipmb] IPMB-addr lun netfn [seq] cmd [data1 [data2 ...]]
Send a command to a device on the IPMB bus. The "ipmb" string is optional. The seq must be provided if the netfn is a response (an
odd number). It must be the same sequence number that came in on the command in the "Command Sequence = seq" part of the command.
channel 00 IPMB-addr lun netfn cmd [data1 [data2 ...]]
Send a broadcast command to a device on the IPMB bus.
channel lan handle remote-swid local-swid lun netfn cmd [data1 [data ...]]
Send a command to a device over a LAN channel. Note that this not the same as a LAN connection. This sends a message through a
local BMC to a remote system that is hooked up with a LAN connection.
test_lat count command
Executes the given commands (one of the previous commands) count times and gives the average time per command to execute. Note that
"count" is hexadecimal.
help Display some help.
regcmd netfn cmd
Register to receive the given command. If the driver receives an external command, it will print it out. This only works with sys-
tem interface connections, it will not work on LAN connections.
unregcmd netfn cmd
Remove a command registration.
SEE ALSO
ipmi_ui(1), ipmilan(8), openipmi_conparms(7)
KNOWN PROBLEMS
The asychronous nature of the program can be annoying.
AUTHOR
Corey Minyard <cminyard@mvista.org>
OpenIPMI 05/13/03 openipmicmd(1)