Sponsored Content
Top Forums Shell Programming and Scripting CUT command delimiter in reverse Post 302477301 by skcvasanth on Saturday 4th of December 2010 06:08:59 AM
Old 12-04-2010
Hi rdcwayx,

Thanks for you reply!
It works in both the way. But the 2nd one suits my situation well becuase somtime i can have only one .(dot) in my input or 2 or 3 .(dots) somtime. I'm little new... and i don't understand the below code Smilie

Quote:
EXTN=${a##*.}
It would be great if you can you explain me the above code.

Thanks,
Vasanth.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Dynamic delimiter in cut command

hello.. my prob is as follows: i have to read from a file which may have different formats depending upon the delimiter used in the data of the file.now i need that the user input the delimiter.the input delimiter is stored in a variable and is used on cut command to retrieve necessary... (3 Replies)
Discussion started by: tej.buch
3 Replies

2. Shell Programming and Scripting

How reverse cut or read rows of lines

Hi, My records are like this BSC403_JAIN03|3153_TropicalFarm_LIMJM1-3_97| BSC403_JAIN03|3410_PantaiAceh_PCEHM1_4_97| BSC406_BMIN02|1433_JomHebohTV3_COW7M1_11_97| I want to extract the value before _97| This command BSC_ID=`echo $DATA | cut -f5 -d"_"` gives me _97|, 4, 11 and by... (16 Replies)
Discussion started by: doer
16 Replies

3. UNIX for Advanced & Expert Users

How can I use double character delimiter in the cut command

Hi All, Can the cut command have double character delimiter? If yes, how can we use it. if my data file contains : apple || mango || grapes i used cut -f1 -d"||" filename but got an error. Plz help.... Thanks. (1 Reply)
Discussion started by: AshishK
1 Replies

4. Shell Programming and Scripting

cut a field, but with reverse order

Hi Everyone, I have one a.txt: a b 001 c b b 002 c c c, not 002 c The output should be 001 002 002 If i use cut -f 3 -d' ', this does not work on the 3rd line, so i thought is any way to cut the field counting from the end? or any perl thing can do this?:confused: ... (3 Replies)
Discussion started by: jimmy_y
3 Replies

5. Shell Programming and Scripting

Cut or awk in reverse

I may be making this too hard on myself, but I'm trying to find a way that I can use a cut or awk string to always remove the last two delimited fields of a string. Say I have PackageName-U939393-8.2.3.4.s390x.rpm But the s390x could be any string w/o periods in it, x8664 for example,... (9 Replies)
Discussion started by: cbo0485
9 Replies

6. UNIX for Dummies Questions & Answers

set output delimiter as tab in cut command

I can not make it work, it prints \t rather than introduce tabs. cut -d "," -f 4,8 Samples.csv --output-delimiter="\t" | sort > out Since I am running this command within a shell script, I tried manually inserting tab in this command, still does not work. I am using bash shell Suggestions... (8 Replies)
Discussion started by: analyst
8 Replies

7. Shell Programming and Scripting

How to cut by delimiter, and delimiter can be anything except numbers?

Hi all, I have a number of strings like below: //mnt/autocor/43°13'(33")W/ and i'm trying to get the numbers in this string, for example 431333 please help thanks ahead (14 Replies)
Discussion started by: sunnydanniel
14 Replies

8. UNIX for Dummies Questions & Answers

How to cut part of a string in reverse?

Hi, how to cut part of a string sing delimiter in reverse input file 1,2,st-pa-tr-01,2,3,4, 2,3,ff-ht-05,6,7,8 how can i obtain strings till st-pa-tr ff-ht i.e cutting the last part og string -01 and -05 Thanks & Regards Nivi edit by bakunin: changed thread title (typo) (3 Replies)
Discussion started by: nivI
3 Replies

9. Shell Programming and Scripting

Problem in using cut command with pipe as a delimiter while using in a script

There is a text file in my project named as "mom.txt" in which i want to have contents like.................. LSCRM(Application Name): 1: This is my first application. 2: Today we did shell scripting automation for this app. 3: It was really a good fun in doing so. 4: Really good.| (Here i... (7 Replies)
Discussion started by: Abhijeet Anand
7 Replies

10. Shell Programming and Scripting

Cut command with dynamic passing of delimiter and position values

Hi All, We have a requirement of picking nth position value by using cut command. value would be delimited by any symbols. We have to pass delimited value and postition to get the value in a string. ex. echo "A,B,C,D,E" |cut -d "," -f3 echo "A|B|C|D|E"|cut -d "|" -f2 Kindly frame the... (5 Replies)
Discussion started by: KK230689
5 Replies
xcb-examples(3) 						   XCB examples 						   xcb-examples(3)

NAME
xcb-examples - manpage examples DESCRIPTION
Many of the XCB manpages contain example code. These examples intend to explain how to use one particular part of XCB. They almost never represent a standalone (or even useful) program - X11 programs are relatively involved and thus beyond the scope of a manpage example. ENVIRONMENT
Every example assumes you have an xcb_connection and possibly other variables at hand. For illustrating how xcb_get_property works, you need the window of which you want to get the property, for example. To make it clear that these variables are your responsibility, these examples consist of a single function which takes the necessary variables as parameters. FLUSHING
Flushing means calling xcb_flush to clear the XCB-internal write buffer and send all pending requests to the X11 server. You don't explic- itly need to flush before using a reply function (like xcb_query_pointer_reply), but you do need to flush before entering the event loop of your program. There are only two cases when XCB flushes by itself. The first case is when its write buffer becomes full, the second case is when you are asking for the reply of a request which wasn't flushed out yet (like xcb_query_pointer_reply). This last point also includes xcb_request_check(). Please note that waiting for an event does NOT flush. Examples generally include the xcb_flush call where appropriate (for example after setting a property). Therefore, including these func- tions and calling them in your application should just work. However, you might get better results when flushing outside of the function, depending on the architecture of your program. COMPILATION
If an example does not compile (without warnings) when using -std=c99, that is considered a documentation bug. Similarly, not handling errors or leaking memory is also considered a documentation bug. Please inform us about it on xcb@lists.freedesktop.org. CODING STYLE
Every example uses 4 spaces for indention. Comments are in asterisks, like /* this */. No line is longer than 80 characters (including indention). SEE ALSO
xcb_connect(3), xcb_get_property(3), xcb_flush(3) AUTHOR
Michael Stapelberg <michael+xcb at stapelberg dot de> XCB
2011-12-11 xcb-examples(3)
All times are GMT -4. The time now is 12:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy