Sponsored Content
Top Forums UNIX for Advanced & Expert Users Removing first character in a string Post 302075565 by Raom on Monday 5th of June 2006 08:25:47 AM
Old 06-05-2006
length=$(echo $1|fold -1|wc -l)
((length=length-1))
str=$(echo $1 | fold -1|tail -$length | xargs echo|tr -d ' ')
echo $str
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Removing the ^M character in VI

Hello, I am attempting to remove all the ^M characters in a file in VI. The command I am using is :1,$s/^V^M//g but it doesn't work, saying 'substitute pattern match failed'. Any ideas why? Jules (2 Replies)
Discussion started by: julesinbath
2 Replies

2. Shell Programming and Scripting

Removing character ' from a variable

Hello there, I have a variable in the form of '/example/file.txt' . I want to remove the ' characters from the beginning and the end so that the my new variable becomes /example/file.txt . How can I do it in a script? I know this is a fairly easy question, but i wasn't able to implement it. (3 Replies)
Discussion started by: sertansenturk
3 Replies

3. Shell Programming and Scripting

Korn: How to loop through a string character by character

If I have a string defined as: MyString=abcde echo $MyString How can I loop through it character by character? I haven't been able to find a way to index the string so that I loop through it. shew01 (10 Replies)
Discussion started by: shew01
10 Replies

4. Shell Programming and Scripting

Removing last character of string

Hi , I have a file with the following contents in file test1.txt . AMY_MTT_240Y001,N60_PG2_10G001,A2H_P3H_10G002,7C7_7D7_NP1,A2E_PV0_10G002,L78_PG1_64S001,A2H_P2M_NP2,LDN_YSN_64S001,WV6_WYV_64... (5 Replies)
Discussion started by: kinny
5 Replies

5. Shell Programming and Scripting

Need some help removing a character from name

I have a file like this: DDD_ABCDE2AB2_1104081408.104480 I need to remove the 1 after the . in the file name so that it reads: DDD_ABCDE2AB2_1104081408.04480 Having some difficulty getting the command to work. I tried using cut -d 26 but that just doesn't work. (3 Replies)
Discussion started by: bbbngowc
3 Replies

6. UNIX for Dummies Questions & Answers

Removing a character

I need to remove square brackets from output of script. Output is: and I need to remove the square brackets so I am lett with 121 Is sed the only means to do this and if so what are the options? ...ok so far I have managed to get rid of ] by using /usr/bin/sed 's/]//' but that... (5 Replies)
Discussion started by: rob171171
5 Replies

7. UNIX for Dummies Questions & Answers

Need help removing last character of every line if certain character

I need help removing the last character of every line if it is a certain character. For example I need to get rid of a % character if it is in the last position. Input: aaa% %bbb ccc d%dd% Output should be: aaa %bbb ccc d%dd I tried this but it gets rid of all of the % characters.... (5 Replies)
Discussion started by: raptor25
5 Replies

8. Shell Programming and Scripting

removing last character

Hi, I have a file that has data something like below: A B C D ..... ...... .....and so on I am trying to bring it in one line with comma delimited something like below : A,B,C,D I tried the something below in the code section: cat File.txt | tr '\n' ',' (1 Reply)
Discussion started by: rkumar28
1 Replies

9. UNIX for Dummies Questions & Answers

[Solved] Removing an 8 character string

Edit: Figured it out. Close the thread please. Solution: \{8}\] edit by bakunin: no need to close the thread, but i changed the title to SOLVED. Thanks for writing a follow-up. (0 Replies)
Discussion started by: unknownn
0 Replies

10. Shell Programming and Scripting

sed searches a character string for a specified delimiter character, and returns a leading or traili

Hi, Anyone can help using SED searches a character string for a specified delimiter character, and returns a leading or trailing space/blank. Text file : "1"|"ExternalClassDEA519CF5"|"Art1" "2"|"ExternalClass563EA516C"|"Art3" "3"|"ExternalClass305ED16B8"|"Art9" ... ... ... (2 Replies)
Discussion started by: fspalero
2 Replies
Character(3m17n)						 The m17n Library						  Character(3m17n)

NAME
Character - Character objects and API for them. Defines #define MCHAR_MAX Maximum character code. Functions MSymbol mchar_define_property (const char *name, MSymbol type) Define a character property. void * mchar_get_prop (int c, MSymbol key) Get the value of a character property. int mchar_put_prop (int c, MSymbol key, void *val) Set the value of a character property. MCharTable * mchar_get_prop_table (MSymbol key, MSymbol *type) Get the char-table for a character property. Variables: Keys of character properties These symbols are used as keys of character properties. MSymbol Mscript Key for script. MSymbol Mname Key for character name. MSymbol Mcategory Key for general category. MSymbol Mcombining_class Key for canonical combining class. MSymbol Mbidi_category Key for bidi category. MSymbol Msimple_case_folding Key for corresponding single lowercase character. MSymbol Mcomplicated_case_folding Key for corresponding multiple lowercase characters. MSymbol Mcased Key for values used in case operation. MSymbol Msoft_dotted Key for values used in case operation. MSymbol Mcase_mapping Key for values used in case operation. MSymbol Mblock Key for script block name. Detailed Description Character objects and API for them. The m17n library represents a character by a character code (an integer). The minimum character code is 0. The maximum character code is defined by the macro MCHAR_MAX. It is assured that MCHAR_MAX is not smaller than 0x3FFFFF (22 bits). Characters 0 to 0x10FFFF are equivalent to the Unicode characters of the same code values. A character can have zero or more properties called character properties. A character property consists of a key and a value, where key is a symbol and value is anything that can be cast to (void *). 'The character property that belongs to character C and whose key is K' may be shortened to 'the K property of C'. Define Documentation #define MCHAR_MAX Maximum character code. The macro MCHAR_MAX gives the maximum character code. Variable Documentation MSymbol Mscript Key for script. The symbol Mscript has the name 'script' and is used as the key of a character property. The value of such a property is a symbol representing the script to which the character belongs. Each symbol that represents a script has one of the names listed in the Unicode Technical Report #24. MSymbol Mname Key for character name. The symbol Mname has the name 'name' and is used as the key of a character property. The value of such a property is a C-string representing the name of the character. MSymbol Mcategory Key for general category. The symbol Mcategory has the name 'category' and is used as the key of a character property. The value of such a property is a symbol representing the general category of the character. Each symbol that represents a general category has one of the names listed as abbreviations for General Category in Unicode. MSymbol Mcombining_class Key for canonical combining class. The symbol Mcombining_class has the name 'combining-class' and is used as the key of a character property. The value of such a property is an integer that represents the canonical combining class of the character. The meaning of each integer that represents a canonical combining class is identical to the one defined in Unicode. MSymbol Mbidi_category Key for bidi category. The symbol Mbidi_category has the name 'bidi-category' and is used as the key of a character property. The value of such a property is a symbol that represents the bidirectional category of the character. Each symbol that represents a bidirectional category has one of the names listed as types of Bidirectional Category in Unicode. MSymbol Msimple_case_folding Key for corresponding single lowercase character. The symbol Msimple_case_folding has the name 'simple-case-folding' and is used as the key of a character property. The value of such a property is the corresponding single lowercase character that is used when comparing M-texts ignoring cases. If a character requires a complicated comparison (i.e. cannot be compared by simply mapping to another single character), the value of such a property is 0xFFFF. In this case, the character has another property whose key is Mcomplicated_case_folding. MSymbol Mcomplicated_case_folding Key for corresponding multiple lowercase characters. The symbol Mcomplicated_case_folding has the name 'complicated-case-folding' and is used as the key of a character property. The value of such a property is the corresponding M-text that contains a sequence of lowercase characters to be used for comparing M-texts ignoring case. MSymbol Mcased Key for values used in case operation. The symbol Mcased has the name 'cased' and is used as the key of charater property. The value of such a property is an integer value 1, 2, or 3 representing 'cased', 'case-ignorable', and both of them respective. See the Unicode Standard 5.0 (Section 3.13 Default Case Algorithm) for the detail. MSymbol Msoft_dotted Key for values used in case operation. The symbol Msoft_dotted has the name 'soft-dotted' and is used as the key of charater property. The value of such a property is Mt if a character has 'Soft_Dotted' property, and Mnil otherwise. See the Unicode Standard 5.0 (Section 3.13 Default Case Algorithm) for the detail. MSymbol Mcase_mapping Key for values used in case operation. The symbol Mcase_mapping has the name 'case-mapping' and is used as the key of charater property. The value of such a property is a plist of three M-Texts; lower, title, and upper of the corresponding character. See the Unicode Standard 5.0 (Section 5.18 Case Mappings) for the detail. MSymbol Mblock Key for script block name. The symbol Mblock the name 'block' and is used as the key of charater property. The value of such a property is a symbol representing a script block of the corresponding character. Author Generated automatically by Doxygen for The m17n Library from the source code. COPYRIGHT
Copyright (C) 2001 Information-technology Promotion Agency (IPA) Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST) Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License <http://www.gnu.org/licenses/fdl.html>. Version 1.6.2 12 Jan 2011 Character(3m17n)
All times are GMT -4. The time now is 09:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy