I assume that if I reverse the logic, the result will still remain the same ??
Just thinking of others who will need to read it (more pedantic than anything else I guess).
Hi,
Can you please help me with this one: I write an "if" statement, something like this:
if
then
echo "big file"
else
echo "normal file"
and I get an error: `'then is not expected
Thanks in advance (6 Replies)
Hi, can someone please tell me what is wrong with this code? I just want it to check if the file size is greater than 2000kb.
if
Thanks!
---------- Post updated at 09:23 PM ---------- Previous update was at 09:21 PM ----------
I should probably post the full code:
#!/bin/sh... (9 Replies)
I'm working on a function in a shell script I'm writing that will eventually take in and print out a list of vendor names and aliases (for my work) Here's the function in question:
addvendorandalias ()
{
echo
echo -n 'Would you like to create a new vendor list (y or n)? '
read answer... (3 Replies)
Guy's
I'm trying to create script to execute some critical commands in AIX
like the below ...
stopsrc -s qdaemon
stopsrc -s sshd
stopsrc -s lpd
stopsrc -s nfsd
I want between each command to ask me like this
" are you sure to stop qdaemon "
" are you sure to stop ssh"
" are... (3 Replies)
It saves me lot of typing and space/lines when I do not use full 'if' keyword and construct, instead use ..
&& <statement> || <statement>
that perfectly replaces..
if ; then
<statement>
else
<statement>
fi
Can I use following syntax when I want to add multiple statements under 'if'... (4 Replies)
Hi,
Is there a way to compare the value in if condition with a list of values.
eg . if ]
then
echo "it's a mammal"
else
echo "its not"
fi
Thanks! (8 Replies)
Hi
Can you please tell me what is wrong with this line:
if && ]; then
basically i want to check if x = 12 and F (Filename) end with 'g'. But it is throwing syntax error. (7 Replies)
I am getting the following error when I am running a script in ksh when trying to execute an if statement comparing two numerical values
tstmb.sh: 1.5321e+08: 0403-057 Syntax error
Below is my code snippet.
#!/bin/ksh
set -x
TODAY=$(date +%y%m%d)
for file in $(ls -rt *.log | tail... (11 Replies)
I want to make the file test condition a variable ($Prmshn in code below).
My goal is to use something like the first three unsuccessful if statetments since the 'if
#!/bin/ksh
test_input()
{
Prmshn=${1}
InFLNm=${2}
ifReq="-$Prmshn $InFLNm"
#the following three if statments fail:
#if ] ;... (10 Replies)
I'm new to unix and the command line and am trying to learn different commands. I have a file (teledir.txt) that contains a name and phone number for 3 different people. I am writing a script that is to take two positional parameters and I typed out how it should behave:
if <name and number... (1 Reply)
Discussion started by: Eric7giants
1 Replies
LEARN ABOUT HPUX
smfi_setreply
smfi_setreply(3N)smfi_setreply(3N)NAME
smfi_setreply() - sets the default SMTP error reply code
SYNOPSIS PARAMETERS
ctx Specifies the opaque context structure.
rcode Specifies the 3-digit (RFC 821/2821) SMTP reply code as a null-terminated string. rcode cannot be set to NULL value. rcode must
be a valid or reply code.
xcode Specifies the extended (RFC 1893/2034) reply code. An xcode must conform to RFC 1893/2034. If xcode is set to NULL, an extended
code is not used.
message Specifies the text part of the SMTP reply. If message is set to NULL, an empty message is used.
DESCRIPTION
The routine directly sets the SMTP error reply code for a connection. Only and replies are accepted. uses this code on subsequent error
replies from the Milter function.
can be called from any function except the function.
Notes
o Values passed to are not checked for standards compliance.
o The message parameter must contain only printable characters; other characters may lead to undefined behavior. For example, CR or LF
causes the call to fail, a single (percentage) character can cause the text to be ignored. If a (percentage) character must be used in
a string, it must be used as
o For more information on reply codes and their meanings, see RFC 821, 2821, 1893, or 2034.
o If the reply code (rcode) given is a code but is used for the message, the normal reply is not used.
If the reply code (rcode) given is a code but is used for the message, the custom reply is not used.
In neither of these two cases, an error is returned to the Milter and silently ignores the reply code.
o If the Milter returns and sets the reply code to the SMTP server terminates the SMTP session with a error code.
RETURN VALUE
fails and returns if the rcode or xcode argument is invalid or a memory allocation failure occurs; otherwise; returns
AUTHOR
The routine was developed by the Sendmail Inc.
SEE ALSO smfi_getsymval(3N), smfi_getpriv(3N), smfi_setreply(3N), smfi_setpriv(3N).
on
smfi_setreply(3N)