Sponsored Content
Top Forums Shell Programming and Scripting How can I match the particular character in the string? Post 302672093 by meroko on Sunday 15th of July 2012 11:59:47 PM
Old 07-16-2012
Thank you for your advise but i do not understand the syntax of it ...
so i do not know how to put those statements in my script
would you mind to explain more about the statements?
many thanks!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

match a character in a line and replace

Hi, I have a file with large number of records. Sample below: 123456789QWERT2U 2 erter 987123678ZXCVB6Y 5 7689 934567123GHJKUI4O 7 - -- -- I want the 16th character in each record to be replaced with the below as follows;so 2 will become K, 6 will become O and 4 will become... (3 Replies)
Discussion started by: er_ashu
3 Replies

2. 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

3. Homework & Coursework Questions

character match and count

Use and complete the template provided. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: How can I count number of occurance of a single character in a file.. eg. How many '$' characters are there in account file..! 2. Relevant commands,... (1 Reply)
Discussion started by: aadi_uni
1 Replies

4. Shell Programming and Scripting

exact string match ; search and print match

I am trying to match a pattern exactly in a shell script. I have tried two methods awk '/\<mpath${CURR_MP}\>/{print $1 $2}' multipath perl -ne '/\bmpath${CURR_MP}\b/ and print' /var/tmp/multipath Both these methods require that I use the escape character. I am guessing that is why... (8 Replies)
Discussion started by: bash_in_my_head
8 Replies

5. Shell Programming and Scripting

How to match character with single quote?

I need to check whether first character of variable is single quote. I tried the below constructions but they are all not working (always return true) if (test `echo "$REGEXP" |cut -c1` != "'"); then echo "TRUE"; fi if (test `echo "$REGEXP" |cut -c1` != '\''); then echo "TRUE"; fi if (test... (5 Replies)
Discussion started by: urello
5 Replies

6. Shell Programming and Scripting

awk : match the string and string with the quotes :

Hi all, Here is the data file: - want to match only lan3 in the output . - not lan3:1 file : OPERATING_SYSTEM=HP-UX LOOPBACK_ADDRESS=127.0.0.1 INTERFACE_NAME="lan3" IP_ADDRESS="10.53.52.241" SUBNET_MASK="255.255.255.192" BROADCAST_ADDRESS="" INTERFACE_STATE=""... (2 Replies)
Discussion started by: rveri
2 Replies

7. Shell Programming and Scripting

sed Character match and replace

Hello All I am struck in the issue which I want to share with all of you. What I am trying to do is For every line in a file I have to replace a particular character from the given character in a file For Example Suppose the data is 1111x2222 1111x2222 2222y3333 1111x2222 I... (4 Replies)
Discussion started by: adisky123
4 Replies

8. Shell Programming and Scripting

Match string against character class in bash

Hello, I want to check whether string has only numeric characters. The following code doesn't work for me #!/usr/local/bin/bash if ]]; then echo "true" else echo "False" fi # ./yyy '346' False # ./yyy 'aaa' False I'm searching for solution using character classes, not regex.... (5 Replies)
Discussion started by: urello
5 Replies

9. Shell Programming and Scripting

Extracting character between 2 token - using only first match

Hello. ps -ae return I would like that the following command return 3214 echo " 3214 ? 00:00:01 acroread" | grep -o "]]]*" (5 Replies)
Discussion started by: jcdole
5 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
MB_OUTPUT_HANDLER(3)							 1						      MB_OUTPUT_HANDLER(3)

mb_output_handler - Callback function converts character encoding in output buffer

SYNOPSIS
string mb_output_handler (string $contents, int $status) DESCRIPTION
mb_output_handler(3) is ob_start(3) callback function. mb_output_handler(3) converts characters in the output buffer from internal charac- ter encoding to HTTP output character encoding. PARAMETERS
o $contents - The contents of the output buffer. o $status - The status of the output buffer. RETURN VALUES
The converted string. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 4.1.0 | | | | | | | This handler now adds the charset HTTP header | | | when the following conditions are met: | | | | | | o Content-Type has not been set, | | | using header(3). | | | | | | o The default MIME type begins with | | | text/. | | | | | | o The mbstring.http_input setting | | | is something other than | | | pass. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 mb_output_handler(3) example <?php mb_http_output("UTF-8"); ob_start("mb_output_handler"); ?> NOTES
Note If you want to output binary data, such as an image, using PHP 4.3.0 or later, a Content-Type: header must be set using header(3) before any binary data is sent to the client (e.g. header("Content-Type: image/png")). If Content-Type: header is sent, output char- acter encoding conversion will not be performed. Note that if 'Content-Type: text/*' is sent, the content body is regarded as text; conversion will take place. If you want to output binary data, such as an image, using PHP 4.2.x or earlier, you must set output encoding to "pass" using mb_http_output(3). SEE ALSO
ob_start(3). PHP Documentation Group MB_OUTPUT_HANDLER(3)
All times are GMT -4. The time now is 11:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy