Sponsored Content
Full Discussion: problems with If
Top Forums UNIX for Dummies Questions & Answers problems with If Post 302273655 by Gayucvns on Monday 5th of January 2009 12:03:24 PM
Old 01-05-2009
Hi,

Pls remove space while assigning value to variable. And try the same.

Hope this should work. Also pls post the error msg what you are getting.

Thanks
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

'make' problems (compliation problems?)

I'm trying to compile and install both most recent version of 'make' and the most recent version of 'openssh' on my Sparc20. I've run into the following problems... and I don't know what they mean. Can someone please help me resolve these issues? I'm using the 'make' version that was... (5 Replies)
Discussion started by: xyyz
5 Replies

2. UNIX for Dummies Questions & Answers

Few problems

Hi how can i do this? 1) shell script which writes data and time on to a file if filesystem exceeds 70% of space. 2) make entry to cron table to run a script every 15 mins. and can anyone expplain or demonstrate the difference between variables used in inside a function and outside a... (3 Replies)
Discussion started by: vivekshankar
3 Replies

3. UNIX for Advanced & Expert Users

Problems with Last

Hi, I,ve a Unixware 7.1.3 working correctly for two years ago, since a several weeks I've a problem with the command last . The information that this command return is : For example : 1.- The user root , time login : 12:15 h, time logoff 12:15 h (the real time is 14:00). Connected time is... (3 Replies)
Discussion started by: By_Jam
3 Replies

4. UNIX for Dummies Questions & Answers

Problems with using less

Hello, I am having problems with using less on Linux version 2.6.18-92.1.17.el5 (brewbuilder@hs20-bc1-7.build.redhat.com) (gcc version 4.1.2 20071124 (Red Hat 4.1.2-42)). I am using csh but have the same problems on bash. If I pipe something to less it works perfectly i.e. cat file | less... (9 Replies)
Discussion started by: z1dane
9 Replies

5. Shell Programming and Scripting

Problems with $?

Hello, I have the following piece of code that tries to retrieve the result of a .sh: . $HOME/prueba/Scripts/Recogida/recogida_sedra.sh resultado=$? echo "el resultado es : $resultado" if ; then echo "Se va a preprocesar los archivos" In the code of recogida.sh I have the... (8 Replies)
Discussion started by: danietepa
8 Replies

6. SuSE

Problems!!

good friends I am new to linux and I have the following TELNET service problem entering data devo telnet to a Windows server 2003 server and passes will not let me since the move to this server by telnet tells me the characters and thus invalidates me income, I have a service application... (1 Reply)
Discussion started by: pepetico
1 Replies

7. UNIX for Dummies Questions & Answers

Problems with IF Else ??!!

I have written the following code in cygwin to create directories in windows based on the parameter passed. echo $1 > fullpath path1=`awk -F / '{print $1}' $fullpath path2=`awk -F / '{print $2}' $fullpath if then if then if then continue ... (4 Replies)
Discussion started by: janardhanamk
4 Replies

8. Shell Programming and Scripting

If/then problems

#! /bin/bash # ask what the user would like to do CMD=$CMD MBA=$MB RS=$RS CT=$CT echo echo -n "What would you like to do?? REMEMBER WHEN PROGRAMMING ICP's TO SELECT CORRECT COMMAND ACCORDING TO NECCESSARY TYPE CODE! Please enter a command ct = program ctek ... (5 Replies)
Discussion started by: tdalyman
5 Replies

9. Shell Programming and Scripting

About ps -ef and if-else problems

I'm new in Shell Programming and Scripting, I would like to ask some questions. ps -ef | grep $appNAme | grep -v grep <-- what will it return when it find a process is running? return 1 or 0 if then exit 1 <--- if = 0 , run this ? else continue <--- if = 1 , run this ?... (5 Replies)
Discussion started by: LoAlex
5 Replies
UNIMSG(3)						   BSD Library Functions Manual 						 UNIMSG(3)

NAME
uni_msg_len, uni_msg_space, uni_msg_leading, uni_msg_size, uni_msg_ensure, uni_msg_append, uni_msg_extend, uni_msg_alloc, uni_msg_build, uni_msg_destroy, uni_msg_strip32, uni_msg_get32, uni_msg_append32, uni_msg_append8, uni_msg_trail32, uni_msg_dup -- ATM signalling library - message buffers LIBRARY
Begemot ATM signalling library (libunimsg, -lunimsg) SYNOPSIS
#include <uni4/unimsg.h> size_t uni_msg_len(const struct uni_msg *msg); size_t uni_msg_space(const struct uni_msg *msg); size_t uni_msg_leading(const struct uni_msg *msg); size_t uni_msg_size(const struct uni_msg *msg); int uni_msg_ensure(struct uni_msg *msg, size_t bytes); int uni_msg_append(struct uni_msg *msg, void *buf, size_t buflen); int uni_msg_extend(struct uni_msg *msg, size_t bytes); struct uni_msg * uni_msg_alloc(size_t space); struct uni_msg * uni_msg_build(void *buf, ...); void uni_msg_destroy(struct uni_msg *msg); u_int uni_msg_strip32(struct uni_msg *msg); u_int uni_msg_get32(struct uni_msg *msg); int uni_msg_append32(struct uni_msg *msg, u_int value); int uni_msg_append8(struct uni_msg *msg, u_int byte); u_int uni_msg_trail32(const struct uni_msg *msg, int n); struct uni_msg * uni_msg_dup(const struct uni_msg *msg); DESCRIPTION
These functions are used to manipulate variable sized message. They are inspired by BSD mbufs and SysV stream buffers, but somewhat simpli- fied because signalling generally is a low bandwidth task. All the functions operation on a uni_msg data structure: struct uni_msg { u_char *b_wptr; /* tail pointer */ u_char *b_rptr; /* head pointer */ u_char *b_buf; /* data buffer */ u_char *b_lim; /* end of data buffer */ }; The field b_buf points to the begin of a memory block that is used to store the actual message and the field b_lim points just to the first byte behind that buffer. This buffer is allocated separate from the structure itself and the user calling any of the above functions with a non const struct uni_msg argument should expect the buffer to be reallocated and hence not hold pointers into the buffer accross call to these functions. The pointer b_rptr points to the first used byte in the message and b_wptr to the first unused byte behind all used bytes. If the message is empty, both pointers point to the same place somewhere in the allocated buffer. There are several functions and macros that return various sizes and lengths. The macro uni_msg_len() returns the actual size of the message (the number of used bytes). The macro uni_msg_space() returns the number of bytes that are left unused behind the used space. The macro uni_msg_leading() returns the number of bytes that are unused before the used space and the macro uni_msg_size() returns the maximum size of the message (that is the size of the allocated buffer). Two functions may be used to create new messages: The function uni_msg_alloc() allocates the message structure and a buffer to hold at least space bytes (In fact it allocates a couple of bytes more). If the allocation fails NULL is returned. The pointers are setup so that there is no leading space in the buffer. The function uni_msg_build() constructs a new message from a variable number of buffers. The arguments are pairs of void * pointers to buffers and size_t buffer sizes, terminated by a NULL pointer. The function computes the total resulting message size, allocates a message and copies all the buffers into the message. The message is built to have no leading space. If the allo- cation fails, NULL is returned. The function uni_msg_destroy() deallocates the buffer pointed to by the message and the message itself. It is save to pass a message with a NULL buffer, but not a NULL message. The function uni_msg_dup() returns a copy of a message with exact the same leading space. A number of functions are used to add bytes to an existing message. The function uni_msg_extend() extends the message buffer to have space for at least bytes additional byte at the end. The leading space does not change. This function may reallocate the message buffer. The function returns 0 on success and ENOMEM if the reallocation fails. In this case the message buffer is not changed. The macro uni_msg_ensure() checks whether the message has space for additional bytes bytes. If not it calls uni_msg_extend() to make the message buf- fer larger. The macro returns 0 on success or ENOMEM if there is not enough space and the reallocation fails. In this case the message buf- fer is not changed. The function uni_msg_append() appends buflen bytes from the buffer pointed to by buf to the message. The function uni_msg_append8() appends one byte to the message and the function uni_msg_append32() appends a 32-bit value in network byte order to the message (b_wptr needs not to be aligned). All three functions call uni_msg_ensure() to make sure, that the buffer contents fit into the mes- sage. They return 0 on success and ENOMEM if the buffer is too small and the reallocation fails. In this case the message buffer is not changed. A number of functions can be used to retrieve parts of the message. The function uni_msg_strip32() returns the last four bytes of the mes- sage as a 32-bit integer assumed to be in network byte order. It adjusts b_wptr to remove these four bytes from the message. b_wptr does not need to be aligned. The function uni_msg_get32() returns the first four bytes of the message as a 32-bit integer assumed to be in net- work byte order. It adjusts b_rptr to remove these four bytes from the message. b_rptr does not need to be aligned. The function uni_msg_trail32() returns the n 'th 32-bit integer from the buffer counted from the end of the buffer. The integer is assumed to be in net- work byte order. A value of -1 for n returns the last four bytes of the buffer, a value of -2 the four bytes just before the last four bytes and so on. All three functions do not check that the message is large enough. SEE ALSO
libunimsg(3), mbuf(9) AUTHORS
Hartmut Brandt <harti@FreeBSD.org> BSD
June 14, 2005 BSD
All times are GMT -4. The time now is 11:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy