Sponsored Content
Full Discussion: appending space to variable
Top Forums Shell Programming and Scripting appending space to variable Post 302164168 by viv1 on Monday 4th of February 2008 05:19:39 AM
Old 02-04-2008
appending space to variable

Hi
I need to write a script where there the user enters 3 input parameter
variable
number
the program should ask the user left or right
if it is left , the number specified that many spaces should be added to the value in front of the value and saved in the samee variable itself and if it is right that many number of spaces should be added in the right side

for ex
variable = vivek
number =4
and when user echo $variable output should be
if user opts for right then output = (4 spaces in front)vivek
if user opts for left then output =vivek(4 spaces in back)
 

10 More Discussions You Might Find Interesting

1. Programming

appending space in binary data in c

Hi ... I am having a string in the buffer .. It is binary data it may contain space . When i try to append a space in using strcpy it is taking the inbetween \n as the end and appending space .. How to append space in the binary data in C ?? please let me know Thanks in advance, Arun. (2 Replies)
Discussion started by: arunkumar_mca
2 Replies

2. Shell Programming and Scripting

Sed - Appending a line with a variable on it

Hi, I searched the forum for this but couldn't find the answer. Basically I have a line of code I want to insert into a file using sed. The line of code is basically something like "address=1.1.1.1" where 1.1.1.1 is an IP Address that will vary depending on what the user enters. I'll just refer... (4 Replies)
Discussion started by: eltinator
4 Replies

3. Shell Programming and Scripting

appending spaces to a variable

Hi All, I have a requirement, in which i have to append some spaces to the variable, and then send it to another function. I am new to the UNIX shell programming. Ultimately the length of the string should be 40 characters. exp: Login = "rallapalli" (length = 10) i have to append 30 spaces to... (2 Replies)
Discussion started by: rallapalli
2 Replies

4. Shell Programming and Scripting

Appending to a variable?

Hey, I'm creating a custom useradd script, and I'm giving the option to add secondary groups. Basically what I want to do is ask for the name of the group, you type in the group you want to add, it assigns that group name to the variable $sgroup. Then the scripts asks if you want add another. If... (0 Replies)
Discussion started by: paqman
0 Replies

5. UNIX for Dummies Questions & Answers

appending variable number of files

In a particular path of a server I have number of files.The files are generated every date with a date_mth stap on this.There are different files for different clients. For example in /data1 path i have X_0416_Score Y_0416_Score Z_0417_Score X_0417_Score A_0417_Score If i will run the... (1 Reply)
Discussion started by: dr46014
1 Replies

6. Shell Programming and Scripting

appending strings to variable

is it possible? as i keep reading a file, i want one particular variable to keep storing the line that i've read so far (1 Reply)
Discussion started by: finalight
1 Replies

7. Shell Programming and Scripting

Appending data into a variable

Hi, I would like to know if it's possible to append data into a variable, rather than into a file. Although I can write information into a temporary file in /tmp, I'd rather if possible write into a variable, as I don't like the idea that should my script fail, I'll be polluting the server with... (5 Replies)
Discussion started by: michaeltravisuk
5 Replies

8. Shell Programming and Scripting

Blank Space is not appending in each row of CSV File - Shell Script

I am calling SQL script in my UNIX Shell script and trying to create the CSV file and my last column value of each row is 23 blank spaces. In my SQL script,the last column is like below. RPAD(' ',23,' ') -- Padding 23 blank Spaces The CSV file is generated but the sapce(23 spaces) is... (2 Replies)
Discussion started by: praka
2 Replies

9. Shell Programming and Scripting

Appending value to variable

I have a Query! by using command cat >> file1 we can append data's to a already existing file, Similarly is it possible to append a data to a variable. Thanks in Advance!! (2 Replies)
Discussion started by: gwgreen1
2 Replies

10. Shell Programming and Scripting

Appending timestamp to a file. Why do I need this space ?

Version Info $ cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.4 (Tikanga) $ $ echo $0 -ksh I was trying to append date to the file name. The following syntax has worked $ touch HELLO-`date '+%d-%b-%Y'`.txt $ ls -alrt HELL* -rw-r--r-- 1 rlapp oinstall 0 Feb 20... (2 Replies)
Discussion started by: John K
2 Replies
GLDRAWBUFFERS(3G)						    OpenGL 3.3							 GLDRAWBUFFERS(3G)

NAME
glDrawBuffers - Specifies a list of color buffers to be drawn into C SPECIFICATION
void glDrawBuffers(GLsizei n, const GLenum *bufs); PARAMETERS
n Specifies the number of buffers in bufs. bufs Points to an array of symbolic constants specifying the buffers into which fragment colors or data values will be written. DESCRIPTION
glDrawBuffers defines an array of buffers into which outputs from the fragment shader data will be written. If a fragment shader writes a value to one or more user defined output variables, then the value of each variable will be written into the buffer specified at a location within bufs corresponding to the location assigned to that user defined output. The draw buffer used for user defined outputs assigned to locations greater than or equal to n is implicitly set to GL_NONE and any data written to such an output is discarded. The symbolic constants contained in bufs may be any of the following: GL_NONE The fragment shader output value is not written into any color buffer. GL_FRONT_LEFT The fragment shader output value is written into the front left color buffer. GL_FRONT_RIGHT The fragment shader output value is written into the front right color buffer. GL_BACK_LEFT The fragment shader output value is written into the back left color buffer. GL_BACK_RIGHT The fragment shader output value is written into the back right color buffer. GL_COLOR_ATTACHMENTn The fragment shader output value is written into the nth color attachment of the current framebuffer. n may range from 0 to the value of GL_MAX_COLOR_ATTACHMENTS. Except for GL_NONE, the preceding symbolic constants may not appear more than once in bufs. The maximum number of draw buffers supported is implementation dependent and can be queried by calling glGet() with the argument GL_MAX_DRAW_BUFFERS. NOTES
The symbolic constants GL_FRONT, GL_BACK, GL_LEFT, GL_RIGHT, and GL_FRONT_AND_BACK are not allowed in the bufs array since they may refer to multiple buffers. If a fragment shader does not write to a user defined output variable, the values of the fragment colors following shader execution are undefined. For each fragment generated in this situation, a different value may be written into each of the buffers specified by bufs. ERRORS
GL_INVALID_ENUM is generated if one of the values in bufs is not an accepted value. GL_INVALID_ENUM is generated if the GL is bound to the default framebuffer and one or more of the values in bufs is one of the GL_COLOR_ATTACHMENTn tokens. GL_INVALID_ENUM is generated if the GL is bound to a framebuffer object and one or more of the values in bufs is anything other than GL_NONE or one of the GL_COLOR_ATTACHMENTSn tokens. GL_INVALID_ENUM is generated if n is less than 0. GL_INVALID_OPERATION is generated if a symbolic constant other than GL_NONE appears more than once in bufs. GL_INVALID_OPERATION is generated if any of the entries in bufs (other than GL_NONE ) indicates a color buffer that does not exist in the current GL context. GL_INVALID_VALUE is generated if n is greater than GL_MAX_DRAW_BUFFERS. ASSOCIATED GETS
glGet() with argument GL_MAX_DRAW_BUFFERS glGet() with argument GL_DRAW_BUFFERi where i indicates the number of the draw buffer whose value is to be queried SEE ALSO
glBlendFunc(), glColorMask(), glDrawBuffers(), glLogicOp(), glReadBuffer() COPYRIGHT
Copyright (C) 2003-2005 3Dlabs Inc. Ltd. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/. OpenGL 3.3 03/08/2011 GLDRAWBUFFERS(3G)
All times are GMT -4. The time now is 11:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy