Sponsored Content
Full Discussion: error in if statement
Top Forums UNIX for Dummies Questions & Answers error in if statement Post 302298637 by Jalkukdi@10 on Wednesday 18th of March 2009 08:00:07 AM
Old 03-18-2009
Hammer & Screwdriver

Quote:
Originally Posted by Swapna173

if [ -n $sqlerr ] #sql connection error
then
Status=10
else
Status=$?
fi
try out giving $sqlerr in double quotes like
Code:
if [ -n "$sqlerr" ]

Please let me know whether it works or not as right now i dont have access to unix server.Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

parsing error in if statement

hello, I am trying to parse an error returned by a command inside the if statement but it is just displays the full error instead and then stops. if ; then echo "no such package" else echo "similar version found will use pkgrm" fi the above code just displays please let me know... (2 Replies)
Discussion started by: rakeshou
2 Replies

2. Shell Programming and Scripting

Error with if statement..Please help

:b:hi, I have a script as given below: pr_det="1" if then awk ' BEGIN {printf("%23s","session")}' >> report.txt awk ' BEGIN {printf "\n"} ' >> report.txt else awk ' BEGIN {printf("%55s","file_dsc")} ' >> report.txt awk ' BEGIN {printf("%101s","no_recs")} '... (1 Reply)
Discussion started by: jisha
1 Replies

3. Shell Programming and Scripting

Snytax error on If Statement--help

year=`date '+%Y'` month=`date '+%m'` day=`date '+%d'` day=`expr $day - 1` case $month in 1 | 3 | 5 | 7 | 8 | 10 | 12);; if($day =7 ); then $day=6 fi 4 | 6 | 9 | 11);; if ; then $day=31 fi 2);; if ; then if ; then (2 Replies)
Discussion started by: dannyd_y
2 Replies

4. Linux

error in if statement

Hi , I am getting an error when I run the script for checking word "view" in a file . I am using if statement. like this if then VW_VAR=` cat $TN.${ecmdate}.sql1 | grep -i view | awk '{print $3}' | cut -d '.' -f2 ` echo " VW_$VW_VAR " sed -e... (16 Replies)
Discussion started by: capri_drm
16 Replies

5. Shell Programming and Scripting

Error in IF statement

HI i am getting error while executing the given statement for filename in `cat a/file.lst` do if then echo "Exit Code Description :File $filename - is missing in Input Directory" >a.log exit else count1=`awk 'END {print NR}' $filename` echo "$count1">>a.log count2=`awk 'END {print... (4 Replies)
Discussion started by: ravi214u
4 Replies

6. Shell Programming and Scripting

error in insert statement

hi, When i try to run the code below, i get the following error "ksh: syntax error: `(' unexpected" i am not able to figure it out. Can anyone help me? Code: (2 Replies)
Discussion started by: ragavhere
2 Replies

7. Shell Programming and Scripting

Error in if statement

I am working on script for stale nfs. the file consists of cat data01stale.log - - - - /abcd/backup - - - - /abcd/data Script (16 Replies)
Discussion started by: nareshkumar522
16 Replies

8. Shell Programming and Scripting

If statement Syntax error

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)
Discussion started by: rtagarra
7 Replies

9. Shell Programming and Scripting

Awk/if statement error

Can anybody tell the correct way to use the following awk pattern check within an if statement? When I run this command outside of the if statement cat /tmp/test2.out | awk -v T=$TIME -v G=$GROUP -v C=$CDATE '$0 ~ T && $0 ~ G && $0 ~ C' | grep -i "Starting the group" I get the following... (0 Replies)
Discussion started by: kieranfoley
0 Replies

10. UNIX for Beginners Questions & Answers

Error code with if statement

hello all im new to unix and when i use below script i get an error : #! /bin/bash Echo -e "enter the name of the file : \c" read file_name if then echo "$file_name found" else echo "$file_name not found" fi running the script i get below error : $ ./hello (26 Replies)
Discussion started by: Ibrahims1
26 Replies
LSH-KRB-CHECKPW(8)						    lsh manuals 						LSH-KRB-CHECKPW(8)

NAME
lsh-krb-checkpw - program to check a Kerberos username/password combination SYNOPSIS
lsh-krb-checkpw username-to-check DESCRIPTION
This manual page documents briefly the lsh-krb-checkpw command. This manual page was written for the Debian distribution because the orig- inal program does not have a manual page. Instead, it has documentation in the GNU Info format; see below. lsh-krb-checkpw is a program that checks if a username and password combination is valid for login by doing a kerberos lookup. It is designed to be used as a password helper program for lshd (8), (eg. --password-helper=/usr/sbin/lsh-krb-checkpw. lsh-krb-checkpw takes one required argument, which is the username, and reads the password from stdin, then returns 0 if the password is valid, or 1 otherwise. Note that the password must be supplied exactly, ie. there must be no newline after the password, so if invoking from a shell, just type "<your-password><CTRL-D>". SEE ALSO
lsh(1), lshd(8). The programs are documented fully by Lsh, available via the Info system. AUTHOR
This manual page was written by Timshel Knoll <timshel@debian.org>, for the Debian GNU/Linux system (but may be used by others). lsh-krb-checkpw Nov 15 2005 LSH-KRB-CHECKPW(8)
All times are GMT -4. The time now is 05:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy