Sponsored Content
Full Discussion: bash reading and assigning
Top Forums Shell Programming and Scripting bash reading and assigning Post 302413168 by Learnerabc on Wednesday 14th of April 2010 07:25:16 PM
Old 04-14-2010
Thanks for reply but if there any other way to do this..I mean other than using case in
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Reading file and assigning that to Variable

I am missing something here, I have a file which contains only one line and that is either a number or character string. I am trying to read the file and assign that value to a variable and here it seems I am missing something and not getting the expected results... Here is the code : #!/bin/ksh... (2 Replies)
Discussion started by: Vaddadi
2 Replies

2. UNIX for Dummies Questions & Answers

Reading from a file and assigning values

HI I have something like this in a file ABC = 1 DEF = 2 GHI = 3 JKL = 4 MNO = 5 QRS = 6 TUV = 7 I need to assign ABC to V_abc (that is to a variable) GHI to V_ghi (that is to another variable) TUV to say V_tuv ... (6 Replies)
Discussion started by: ssuresh1999
6 Replies

3. Shell Programming and Scripting

Reading data from file and assigning to variable

I was trying to store the number of lines in a file and store it in a file.after that i want to store the information in a file to a variable which is further used in the if loop to check certain condition. #!/bin/bash cat <file> | wc -l > count.txt x="$count.txt"; i=10; if ; then cat... (10 Replies)
Discussion started by: sudhakaryadav
10 Replies

4. Shell Programming and Scripting

Problem in reading file (bash)

i get a name from user first name : last name, in this format. Now i am saving this to a file. what i want is, I do not want to save any name if I already have one entry o that same name..what should i do for example user give robert fernandez this will save in file as robert:fernandez. if... (5 Replies)
Discussion started by: Learnerabc
5 Replies

5. Shell Programming and Scripting

Help in reading a cv file in bash

Hi All, I am trying to read a .csv file which has some 6 columns. Eg: samp.csv one, two, three, four six, seven, eight, nine I used the following code, for line in `cat samp.csv` do echo "$line" done It displays every comma seperated values in each line like, one,... (1 Reply)
Discussion started by: johnwilliams.sp
1 Replies

6. Shell Programming and Scripting

Help with reading and assigning variables

Hi Gurus, I have a file named log with 2 lines Each line is a file name. eg $ cat log monday tuesday I need to read log and assign each output(filename) to a different variable. The following doesn't work:- while read A B do echo " a is ${A} " echo " b is ${B} " done <... (6 Replies)
Discussion started by: wisdom
6 Replies

7. Shell Programming and Scripting

Bash: Reading a file and assigning variables from file

I have a file that has four values on each line and I'd like to give each column a variable name and then use those values in each step of a loop. In bash, I believe you could use a while loop to do this or possibly a cat command, but I am super new to programming and I'm having trouble decoding... (2 Replies)
Discussion started by: ccorder22
2 Replies

8. Shell Programming and Scripting

Reading from a file and assigning to an array in perl

I wrote a simply perl that searched a file for a particualr value and if it found it, rite it and the next three lines to a file. Now I have been asked to check those next three lines for a different value and only write those lines if it finds the second value. I was thinking the best way to... (1 Reply)
Discussion started by: billprice13
1 Replies

9. Shell Programming and Scripting

Assigning Multiple Comma Separated IP's To A Bash Array

I am in the process of creating a BASH shell scripts for a project at work. So the scenario is as such: I have a file with each line entry separated by ':' ... (3 Replies)
Discussion started by: metallica1973
3 Replies

10. Shell Programming and Scripting

Reading from file bash command

Hello, I have a file in the following format id sample platform R1 R2 gene1 gene2 gene3 1 abc llumina R1_001.fastq.gz R2_001.fastq.gz apoe prnpp asp 2 def llumina R1_001.fastq.gz R2_001.fastq.gz apoe prnpp 3 ghi llumina ... (3 Replies)
Discussion started by: nans
3 Replies
xcb_dri2_connect(3)						   XCB Requests 					       xcb_dri2_connect(3)

NAME
xcb_dri2_connect - SYNOPSIS
#include <xcb/dri2.h> Request function xcb_dri2_connect_cookie_t xcb_dri2_connect(xcb_connection_t *conn, xcb_window_t window, uint32_t driver_type); Reply datastructure typedef struct xcb_dri2_connect_reply_t { uint8_t response_type; uint8_t pad0; uint16_t sequence; uint32_t length; uint32_t driver_name_length; uint32_t device_name_length; uint8_t pad1[16]; } xcb_dri2_connect_reply_t; Reply function xcb_dri2_connect_reply_t *xcb_dri2_connect_reply(xcb_connection_t *conn, xcb_dri2_connect_cookie_t cookie, xcb_generic_error_t **e); Reply accessors char *xcb_dri2_connect_driver_name(const xcb_dri2_connect_request_t *reply); int xcb_dri2_connect_driver_name_length(const xcb_dri2_connect_reply_t *reply); xcb_generic_iterator_t xcb_dri2_connect_driver_name_end(const xcb_dri2_connect_reply_t *reply); void *xcb_dri2_connect_alignment_pad(const xcb_dri2_connect_request_t *reply); int xcb_dri2_connect_alignment_pad_length(const xcb_dri2_connect_reply_t *reply); xcb_generic_iterator_t xcb_dri2_connect_alignment_pad_end(const xcb_dri2_connect_reply_t *reply); char *xcb_dri2_connect_device_name(const xcb_dri2_connect_request_t *reply); int xcb_dri2_connect_device_name_length(const xcb_dri2_connect_reply_t *reply); xcb_generic_iterator_t xcb_dri2_connect_device_name_end(const xcb_dri2_connect_reply_t *reply); REQUEST ARGUMENTS
conn The XCB connection to X11. window TODO: NOT YET DOCUMENTED. driver_type TODO: NOT YET DOCUMENTED. REPLY FIELDS
response_type The type of this reply, in this case XCB_DRI2_CONNECT. This field is also present in the xcb_generic_reply_t and can be used to tell replies apart from each other. sequence The sequence number of the last request processed by the X11 server. length The length of the reply, in words (a word is 4 bytes). driver_name_length TODO: NOT YET DOCUMENTED. device_name_length TODO: NOT YET DOCUMENTED. DESCRIPTION
RETURN VALUE
Returns an xcb_dri2_connect_cookie_t. Errors have to be handled when calling the reply function xcb_dri2_connect_reply. If you want to handle errors in the event loop instead, use xcb_dri2_connect_unchecked. See xcb-requests(3) for details. ERRORS
This request does never generate any errors. SEE ALSO
AUTHOR
Generated from dri2.xml. Contact xcb@lists.freedesktop.org for corrections and improvements. XCB
2014-06-10 xcb_dri2_connect(3)
All times are GMT -4. The time now is 05:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy