Sponsored Content
Full Discussion: How to remove \ character
Top Forums UNIX for Dummies Questions & Answers How to remove \ character Post 302353045 by sandeep_1105 on Monday 14th of September 2009 11:06:19 AM
Old 09-14-2009
Quote:
Originally Posted by vgersh99
Code:
echo 'foo\bar' | tr '\\' '\n'

Thanks vgersh, it works now. You are a Genius. Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove last character of a term

Hi All, I have a few terms with a comma as the last character. Can any experts show me how to remove the last character? Note the the length of the term is not fix. Input: 1, 2, 12, 14, 103, 198, 3006, Output, 1 (6 Replies)
Discussion started by: Raynon
6 Replies

2. UNIX for Advanced & Expert Users

To remove new line character

Hi, I am facing one interesting problem : I have a file which contains data like this 459,|1998-11-047|a |b |c \n efg | d|e | \n 459,|1998-11-047|a \n c|b |c \n efg | d|e | \n Basically what I have to do is , I have to remove all \n which is coming ( enclosed ) in between... (7 Replies)
Discussion started by: shihabvk
7 Replies

3. Shell Programming and Scripting

Remove a ^M character

Hi, I'd like to ask for some help with the following: I've cut a couple of columns of file1 to create file2 with the following code: cur -f 1,3,8 file1 > file2 Then I need to transfer file 2 from UNIX to Windows and use it further. Unfortunatelly, for some reason the line is displayed... (4 Replies)
Discussion started by: zajtat
4 Replies

4. HP-UX

How to remove new line character and append new line character in a file?

Hi Experts, I have data coming in 4 columns and there are new line characters \n in between the data. I need to remove the new line characters in the middle of the row and keep the \n character at the end of the line. File is comma (,) seperated. Eg: ID,Client ,SNo,Rank 37,Airtel \n... (8 Replies)
Discussion started by: sasikari
8 Replies

5. Shell Programming and Scripting

How to remove first 2 character from file name

Hi All Please help me to remove the first 2 character from the file name. files are like this $ ls 12aman file 13atul si 56rana se I want to remove the first 2 char which are numbers. I want the o/p like thus aman file atul si rana se (8 Replies)
Discussion started by: atul9806
8 Replies

6. Shell Programming and Scripting

Remove last character from filename

Hi All, I have different type of file (.txt,.csv,.xml) format in my current directory. My requirement is that I need to remove the last character from the file format. Example count.txt$ csp_rules.csv^ Date.xml~ Need Output: count.txt csp_rules.csv Date.xml How to do that?.... (5 Replies)
Discussion started by: suresh01_apk
5 Replies

7. Shell Programming and Scripting

remove the first and last character of a string

How can i remove the first and last character of strings like below: "^^^613*" "admt130" "^^^613*" "123456" "adg8484" "DQitYV09dh1C" Means i wanna remove the quotes(""). Please help (17 Replies)
Discussion started by: proactiveaditya
17 Replies

8. Shell Programming and Scripting

Remove last newline character..

Hi all.. I have a text file which looks like below: abcd efgh ijkl (blank space) I need to remove only the last (blank space) from the file. When I try wc -l the file name,the number of lines coming is 3 only, however blank space is there in the file. I have tried options like... (14 Replies)
Discussion started by: Sathya83aa
14 Replies

9. Shell Programming and Scripting

How to remove newline character if it is the only character in the entire file.?

I have a file which comes every day and the file data look's as below. Vi abc.txt a|b|c|d\n a|g|h|j\n Some times we receive the file with only a new line character in the file like vi abc.txt \n (8 Replies)
Discussion started by: rak Kundra
8 Replies

10. UNIX for Beginners Questions & Answers

Remove character \r and \n in awk

Hi Everybody: I need your help, please... I have this file *.txt 0000 | 16010201 22000000 67892000 00000000 00000000 00000100 72246681 28E08236 | ~~~~"~~~g~ ~~~~~~~~~~~~~r$f~(~~6 | 0020 | 10476173 90010100 10000000 00000001 05000226 17163011 12442212 48140484 |... (2 Replies)
Discussion started by: solaris21
2 Replies
APC_CAS(3)								 1								APC_CAS(3)

apc_cas - Updates an old value with a new value

SYNOPSIS
bool apc_cas (string $key, int $old, int $new) DESCRIPTION
apc_cas(3) updates an already existing integer value if the $old parameter matches the currently stored value with the value of the $new parameter. PARAMETERS
o $key - The key of the value being updated. o $old - The old value (the value currently stored). o $new - The new value to update to. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 apc_cas(3) example <?php apc_store('foobar', 2); echo '$foobar = 2', PHP_EOL; echo '$foobar == 1 ? 2 : 1 = ', (apc_cas('foobar', 1, 2) ? 'ok' : 'fail'), PHP_EOL; echo '$foobar == 2 ? 1 : 2 = ', (apc_cas('foobar', 2, 1) ? 'ok' : 'fail'), PHP_EOL; echo '$foobar = ', apc_fetch('foobar'), PHP_EOL; echo '$f__bar == 1 ? 2 : 1 = ', (apc_cas('f__bar', 1, 2) ? 'ok' : 'fail'), PHP_EOL; apc_store('perfection', 'xyz'); echo '$perfection == 2 ? 1 : 2 = ', (apc_cas('perfection', 2, 1) ? 'ok' : 'epic fail'), PHP_EOL; echo '$foobar = ', apc_fetch('foobar'), PHP_EOL; ?> The above example will output something similar to: $foobar = 2 $foobar == 1 ? 2 : 1 = fail $foobar == 2 ? 1 : 2 = ok $foobar = 1 $f__bar == 1 ? 2 : 1 = fail $perfection == 2 ? 1 : 2 = epic fail $foobar = 1 SEE ALSO
apc_dec(3), apc_store(3). PHP Documentation Group APC_CAS(3)
All times are GMT -4. The time now is 06:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy