Sponsored Content
Top Forums Shell Programming and Scripting How to replace with "sed" some hex values by other hex values? Post 302919077 by disedorgue on Saturday 27th of September 2014 03:17:22 PM
Old 09-27-2014
Hi,
Examples ( '$' is my prompt ):
Code:
$ echo -e '\xad\xa0' 
��
$ echo -e '\xad\xa0' | od -t x1
0000000 ad a0 0a
0000003
$ echo -e '\xad\xa0' | sed 's/\xad\xa0/\x20\x6e/g' | od -t x1
0000000 20 6e 0a
0000003
$ echo -e '\xad\xa0' | sed 's/\xad\xa0/\x20\x6e/g'
 n
$

Regards.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Modifying binary file by editing Hex values ?

Hi , i'm using special binary file (lotus notes) and modifying an hexadecimal address range with windows hex editor and it works fine ! The file is an AIX one and i'm forced to transfert (ftp) it before modifying it and re-transfert ! NOW i would do this directly under AIX ! I can... (4 Replies)
Discussion started by: Nicol
4 Replies

2. HP-UX

Replace all 'low values" in a file

Hi, I've to replace all low values (hex '00') in a flat file (containing more than 1,000,000 records) with space (hex '20'). I try to use: awk '{gsub("\x00","\x20")}' file_name and I obtain the following response: awk: Line AP000010536900577986 cannot have more than 199 fields.... (2 Replies)
Discussion started by: sw.an
2 Replies

3. Programming

searching files for hex or oct values

I have a set of files without extensions. How can I programatically tell if a file is in gzip format? The gzip file format spec RFC 1952 GZIP File Format Specification version 4.3 states that gzip files have certain hex/oct values at the beginning of the file. 1st byte = 0x1f in hex,... (2 Replies)
Discussion started by: daflore
2 Replies

4. Shell Programming and Scripting

Convert hex values to displayable characters

Hi, I am a bit stuck with displaying characters. I am having values like below in the proper displayable characters. which I would want to print the actual value on the right hand side. I dont want to create an array because I would have to create 255 different values. isnt there another way of... (17 Replies)
Discussion started by: ahmedwaseem2000
17 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. Shell Programming and Scripting

Help search and replace hex values only in specific files

perl -pi -e 's/\x00/\x0d\x0a/g' `grep -l $'GS' filelist` This isn't working :confused:, it's not pulling the files that contain the regex. Please help me rewrite this :wall:. Ideally for this to work on 9K of 20K files in the directory, I've tried this but I don't know enough about awk... (7 Replies)
Discussion started by: verge
7 Replies

7. Shell Programming and Scripting

Converting parts of a string to "Hex"

Hi Guys, writing a small shell script, i need to convert parts of a string to "Hex". The problem is that it is not the full string that needs to be converted. I think it's best to show an example: $astring = "xxxxxx ABC+10+##########+DEF xxxx" This is only an example to show how the... (9 Replies)
Discussion started by: HansHansen
9 Replies

8. Shell Programming and Scripting

Swapping a string of numbers between higher and lower order values(HEX)

I have this below string in a variable cutString=21222222222222222122222222222222 this string is nothing but hex values depicted as below 21:22:22:22:22:22:22:22:21:22:22:22:22:22:22:22 so what i want to achieve is swap the lower order with higher order values in the... (3 Replies)
Discussion started by: vivek d r
3 Replies

9. UNIX for Advanced & Expert Users

Replace hex values using sed command

File lalo.txt contains: Á I need to replace Á by A using sed command. od -x lalo.txt 0000000 c10a 0000002 sed -e 's/\xc1\x0a/A/g' lalo.txt > lalo2.txt Also tried: sed -e 's/\xc3\x81/A/g' lalo.txt > lalo2.txt Output file lalo2.txt still has Á Unix version: SunOS 5.11 ... (9 Replies)
Discussion started by: mrreds
9 Replies

10. Windows & DOS: Issues & Discussions

Convert "hex" foldername to "ascii"

So, I have a folder, containing subdirs like this: 52334d50 52365245 524b4450 524f3350 52533950 52535050 52555550 now I want to go ahead and rename all those folder: hex -> ascii (8 Replies)
Discussion started by: pasc
8 Replies
AUTHBIND-HELPER(8)						Debian Linux manual						AUTHBIND-HELPER(8)

NAME
authbind-helper - helper program to bind sockets to privileged ports without root SYNOPSIS
/usr/lib/authbind/helper addr4-hex port-hex <socket /usr/lib/authbind/helper addr6-hex port-hex 6 <socket DESCRIPTION
helper is the program used by libauthbind, which is in turn used by authbind to allow programs which do not or should not run as root to bind to low-numbered ports in a controlled way. See authbind(1). It may also be used standalone, i.e. without assistance from authbind. Its standard input should be a TCP/IP socket, and it should be passed two or three arguments. The arguments are the address and port number, respectively, to which the caller desires that the socket be bound, and the address family (ommitted for IPv4; the fixed string 6 for IPv6). addr4-hex and port-hex should be hex strings, without leading 0x, of exactly the right length (8 and 4 digits, respectively), being a pair of hex digits for each byte in the address or port number when expressed in host byte order. For example, the port argument is the result of something like sprintf(arg, "%04X", sin.sin_port). addr6-hex should be a string of 32 hex digits, being a pair for each byte in the address, in network byte order. EXIT STATUS
helper will exit with code 0 on success. If possible, helper will return an appropriate errno value as its exit status. If this is not possible it may exit with status 255 or with an exit status corresponding to ENOSYS (Function not implemented). ACCESS CONTROL
See authbind(1) for details of the access control regime implemented by helper. SEE ALSO
authbind(1), bind(2) AUTHOR
authbind and this manpage were written by Ian Jackson. They are Copyright (C)1998,2012 by him and released under the GNU General Public Licence; there is NO WARRANTY. See /usr/doc/authbind/copyright and /usr/doc/copyright/GPL for details. Debian Project 30th August 1998 AUTHBIND-HELPER(8)
All times are GMT -4. The time now is 07:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy