Sponsored Content
Full Discussion: Reverse hexdump without xxd
Top Forums Shell Programming and Scripting Reverse hexdump without xxd Post 302404529 by alister on Tuesday 16th of March 2010 06:44:59 PM
Old 03-16-2010
Assuming the values are space-delimited single bytes in hex:
Code:
$ cat hdump
41 42 43 44
45 46 47 48

echo 'ibase=16' | cat - hdump | tr ' ' \; | bc | awk '{printf("%c",$0)}'
ABCDEFGH

Regards,
Alister

Last edited by alister; 03-16-2010 at 10:31 PM..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Reverse *

when I do $ ls z* List of all files begining with 'z'. But what if I want to do a reverse lookup. Just for interest sake ;) $ ls ztr should be same as $ ls ztr* $ ls zt* $ ls z* (2 Replies)
Discussion started by: azmathshaikh
2 Replies

2. Shell Programming and Scripting

reverse of basename

Hi, Can someone let me know how to find the reverse of the basename i.e i have /apps/tiv/pmon/xxxx.dat and I want /apps/tiv/pmon/ Thanks (7 Replies)
Discussion started by: braindrain
7 Replies

3. Shell Programming and Scripting

Reverse FTP

Hi Everybody, I want to write a script in unix which will automatically FTP a .txt file from my client machine D: drive(Windows) That is I want to FTP a file from my PC to UNIX box but this should be done from UNIX box by a shell script. (i.e. I will invoke the script in UNIX and FTP will be... (4 Replies)
Discussion started by: ganesh123
4 Replies

4. Shell Programming and Scripting

reverse sort

Hello, How do i sort a csv file. i should be sorting column1(varchar),column2*(varchar) in ascending and column4 in descending order(numeric datatype). I tried few combinations of sort, but doesn't seem to be getting the right result. sort -t "," -k 1 -k 2 -k 4nr file any help is... (3 Replies)
Discussion started by: markjason
3 Replies

5. Shell Programming and Scripting

Reverse lookup

hey guys, can anybody help me out here on the following: grep '^\{1,3\}\.\{1,3\}\.\{1,3\}\.\{1,3\}$' ravi.txt mary.txt lisa.txt https://www.unix.com/images/misc/progress.gif i.e what i did was found ip addreses from different files and then i want... (1 Reply)
Discussion started by: ravis83
1 Replies

6. Shell Programming and Scripting

Puzzled with hexdump, hd and ln

How to create a symbolic link to a command with certain argument? When I man hexdump, it is said in the man page that "-C Canonical hex+ASCII display...Calling the command hd implies this option". Actually it is. hd equals to hexdump -C. And then I examined the ln command but find it is a... (5 Replies)
Discussion started by: vistastar
5 Replies

7. Shell Programming and Scripting

reverse matching

Hello guys How can I use egrep to match word1 but not word2...word1. What I mean suppose that I have the following text, and my word1=pizza and word2=eat I hate to eat pizza because I ma eating it each day Pizza is good I like vegetarian and Italian Pizza eating healthy food is... (7 Replies)
Discussion started by: fdc2suxs
7 Replies

8. Shell Programming and Scripting

How to perform a hexdump using dd from start point to end point?

hi, I would like to ask or is it possible to dump a hex using dd from starting point to end point just like the "xxd -s 512 -l 512 <bin file>" I know the redirect hexdump -C but i can't figure it out the combination options of dd. Hope someone can share their knowledge.. Thanks in... (3 Replies)
Discussion started by: jao_madn
3 Replies

9. Shell Programming and Scripting

Edit file hexadecimal with xxd

Hi all: I need edit a hexadecimal file. for example: 000d530: 0000 0000 0000 0000 0000 0000 493a 004f ............I:.O 000d540: 6374 2032 3820 3230 3135 2031 393a 3234 ct 28 2015 19:24 I need to cut the chain(black) and corresponding to hexadecimal from the chain at the end of file... (5 Replies)
Discussion started by: Rodrigo0461
5 Replies
XATTR(1)						    BSD General Commands Manual 						  XATTR(1)

NAME
xattr -- display and manipulate extended attributes SYNOPSIS
xattr [-lrsvx] file ... xattr -p [-lrsvx] attr_name file ... xattr -w [-rsx] attr_name attr_value file ... xattr -d [-rsv] attr_name file ... xattr -c [-rsv] file ... xattr -h | --help DESCRIPTION
The xattr command can be used to display, modify or remove the extended attributes of one or more files, including directories and symbolic links. Extended attributes are arbitrary metadata stored with a file, but separate from the filesystem attributes (such as modification time or file size). The metadata is often a null-terminated UTF-8 string, but can also be arbitrary binary data. One or more files may be specified on the command line. For the first two forms of the command, when there are more than one file, the file name is displayed along with the actual results. When only one file is specified, the display of the file name is usually suppressed (unless the -v option described below, is also specified). In the first form of the command (without any other mode option specified), the names of all extended attributes are listed. Attribute names can also be displayed using ``ls -l@''. In the second form, using the -p option (``print''), the value associated with the given attribute name is displayed. Attribute values are usually displayed as strings. However, if nils are detected in the data, the value is displayed in a hexadecimal representation. The third form, with the -w option (``write''), causes the given attribute name to be assigned the given value. The fourth form, with the -d option (``delete''), causes the given attribute name (and associated value), to be removed. In the fifth form, with the -c option (``clear''), causes all attributes (including their associated values), to be removed. Finally, the last form, with either the -h or --help option, displays a short help message and exits immediately. OPTIONS
-l By default, the first two command forms either displays just the attribute names or values, respectively. The -l option causes both the attribute names and corresponding values to be displayed. For hexadecimal display of values, the output is preceeded with the hexadeci- mal offset values and followed by ASCII display, enclosed by ``|''. -r If a file argument is a directory, act as if the entire contents of the directory recursively were also specified (so that every file in the directory tree is acted upon). -s If a file argument is a symbolic link, act on the symbolic link itself, rather than the file that the symbolic link points at. -v Force the the file name to be displayed, even for a single file. -x Force the attribute value to be displayed in the hexadecimal representation. The -w option normally assumes the input attribute value is a string. Specifying the -x option causes xattr to expect the input in hexa- decimal (whitespace is ignored). The xxd(1) command can be used to create hexadecimal representations from exising binary data, to pass to xattr. EXIT STATUS
The xattr command exits with zero status on success. On error, non-zero is returned, and an error message is printed to the standard error. For system call errors, both the error code and error string are printed (see getxattr(2), listxattr(2), removexattr(2) and setxattr(2) for a complete list of possible error codes). Some attribute data may have a fixed length that is enforced by the system. For example, % xattr -w com.apple.FinderInfo 0 foo xattr: [Errno 34] Result too large: 'foo' The com.apple.FinderInfo attribute must be 32 bytes in length. EXAMPLES
This example copies the com.apple.FinderInfo attribute from the /usr directory to the MyDir directory: % xattr -px com.apple.FinderInfo /usr 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 % xattr -l MyDir % xattr -wx com.apple.FinderInfo "`xattr -px com.apple.FinderInfo /usr`" MyDir % xattr -l MyDir com.apple.FinderInfo: 00000000 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 |........@.......| 00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000020 SEE ALSO
ls(1), xxd(1), getxattr(2), listxattr(2), removexattr(2), setxattr(2) BSD
Nov 29, 2010 BSD
All times are GMT -4. The time now is 03:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy