how to pick out last charactor of a string?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to pick out last charactor of a string?
# 8  
Old 12-22-2005
Code:
echo "${a}"  | ruby -e'puts gets[-2,1]'

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Pick systems

looking for any advise on how to export Pick data from an AIX implementation. i have someone with limited experience that knows how to create a text file from a pick database. (1 Reply)
Discussion started by: jgt
1 Replies

2. Shell Programming and Scripting

Insert one charactor multiple times in VI

Hi Gurus, I forgot the command which can insert one character multiple times. for example: I need 50 "#" #############... I used the command before, it is very convenient. anybody can help this. thanks in advance. (1 Reply)
Discussion started by: Torhong
1 Replies

3. Shell Programming and Scripting

How to check charactor in certain position?

Hi Gurus, I need to check the charactor in certain position. in my file abcdef1234gh ac1234eeeegt acdead1235gh I want to check what is check from position 7 to 10's charactor, if it is 1234, then output the whole line. for above file, I want to get below output abcdef1234gh... (2 Replies)
Discussion started by: ken6503
2 Replies

4. Shell Programming and Scripting

Pick and print

Hi Friends, I'm facing an issue. I am having a file as under : a1 b1 c1 a2 a3 a4 b4 a5 b5 and I need to get the output as under: a1 b1 a4 b4 a5 b5 i.e. to pick the columns where a and b are consecutive and ignoring rest. I was trying some thing sily as: (2 Replies)
Discussion started by: vanand420
2 Replies

5. Shell Programming and Scripting

Split string with blancs to pick up information in a file ?

Hello, I am quite new in shell, and would like to pick up information in a file. The file structure is like this faor all data: T 50 2 2.5 is this a candy number color price I know how to pick up a line. I do this: head -linenumber candyfile.doc | tail -1 But I would... (6 Replies)
Discussion started by: shadok
6 Replies

6. Shell Programming and Scripting

pick columns

I want to be able pick columns from 2 files with similar reference data: File 1 Last NameFirst NameSalaryCityDunnJohn $42,000.00 ChicagoGrantSuzy $95,000.00 GaryLoweMike $80,000.00 MilwaukeeGrantMike $59,000.00 JolietLoweKaren $48,000.00 South BendFile 2 TitleFirst NameLast... (2 Replies)
Discussion started by: sigh2010
2 Replies

7. UNIX for Dummies Questions & Answers

search from specified charactor space

Hello, I'm quite a noobie in programming in UNIX and I was wondering if it is possible to use 'grep' or similar method to find PATTERNS from designated location (of charactor) for example |param 1 ||param2 | andrew kim josh daniel kim michelle michelle andrew kim I hope... (6 Replies)
Discussion started by: akmix
6 Replies

8. Shell Programming and Scripting

Pick the exact value

Hi, How do i pick a particular value from a group of lines using python. for instance from the below sample. How do I pick Value=1 of OuterLines=1 and InnerLine=1 (11 Replies)
Discussion started by: ahmedwaseem2000
11 Replies

9. Solaris

Please help me pick a machine

Hey guys I am new here and like this forum alot. I went to get into Solaris and would like to buy a sun box on ebay. NON rackmount. Problem is there is so many diff types. I am looking for one under the $800 range that can support solaris 10 and have the basics and decent ram. Can you guys... (11 Replies)
Discussion started by: Gnfanatic
11 Replies

10. Shell Programming and Scripting

insert escape charactor within VIM

Hi, I need to send "^[" command to the buffer. I tried to use insert within VIM and press 'ctrl' key and then '^' and '[' key. but it didn't work. Does anyone know how to do it? Thanks a lot! Julie (2 Replies)
Discussion started by: cin2000
2 Replies
Login or Register to Ask a Question
GLUPICKMATRIX(3G)						   OpenGL Manual						 GLUPICKMATRIX(3G)

NAME
gluPickMatrix - define a picking region C SPECIFICATION
void gluPickMatrix(GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint * viewport); PARAMETERS
x, y Specify the center of a picking region in window coordinates. delX, delY Specify the width and height, respectively, of the picking region in window coordinates. viewport Specifies the current viewport (as from a glGetIntegerv() call). DESCRIPTION
gluPickMatrix creates a projection matrix that can be used to restrict drawing to a small region of the viewport. This is typically useful to determine what objects are being drawn near the cursor. Use gluPickMatrix to restrict drawing to a small region around the cursor. Then, enter selection mode (with glRenderMode()) and rerender the scene. All primitives that would have been drawn near the cursor are identified and stored in the selection buffer. The matrix created by gluPickMatrix is multiplied by the current matrix just as if glMultMatrix() is called with the generated matrix. To effectively use the generated pick matrix for picking, first call glLoadIdentity() to load an identity matrix onto the perspective matrix stack. Then call gluPickMatrix, and, finally, call a command (such as gluPerspective()) to multiply the perspective matrix by the pick matrix. When using gluPickMatrix to pick NURBS, be careful to turn off the NURBS property GLU_AUTO_LOAD_MATRIX. If GLU_AUTO_LOAD_MATRIX is not turned off, then any NURBS surface rendered is subdivided differently with the pick matrix than the way it was subdivided without the pick matrix. EXAMPLE
When rendering a scene as follows: glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(...); glMatrixMode(GL_MODELVIEW); /* Draw the scene */ a portion of the viewport can be selected as a pick region like this: glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPickMatrix(x, y, width, height, viewport); gluPerspective(...); glMatrixMode(GL_MODELVIEW); /* Draw the scene */ SEE ALSO
gluPerspective(), glGet(), glLoadIdentity(), glMultMatrix(), glRenderMode() COPYRIGHT
Copyright (C) 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB/. AUTHORS
opengl.org opengl.org 06/10/2014 GLUPICKMATRIX(3G)