Re: [dev] a suckless hex editor

2015-11-16 Thread Snobb
Agreed. Besides if xxd is installed, one can do something like this in vi/vim: :%!xxd make changes :%!xxd -r. Is a shell script really necessary? On 13/11/15 11:45am, Alex Pilon wrote: > On Fri, Nov 13, 2015 at 11:28:36AM -0500, Greg Reagle wrote: > > What do you think? > > > > […] > > > > #!/

Re: [dev] a suckless hex editor

2015-11-15 Thread Greg Reagle
On Sat, Nov 14, 2015 at 10:14:38AM -0500, Matthew of Boswell wrote: > He probably would have said "rm -rf" if he intended for you to delete > the project. At the end of your script, you have 'rm "$tmpfile"'. Got it. Thanks for explaining.

Re: [dev] a suckless hex editor

2015-11-14 Thread Matthew of Boswell
On Sat, 14 Nov 2015 08:48:33 +0100 pancake wrote: > No. Not just this. Rtfm... Rm -f is needed if you dont want a prompt to > remove that file in case of custpm umask or a race condition with another > script happens. > > On 14 Nov 2015, at 03:40, Greg Reagle wrote: > > > >> On Fri, Nov 1

Re: [dev] a suckless hex editor

2015-11-13 Thread pancake
No. Not just this. Rtfm... Rm -f is needed if you dont want a prompt to remove that file in case of custpm umask or a race condition with another script happens. > On 14 Nov 2015, at 03:40, Greg Reagle wrote: > >> On Fri, Nov 13, 2015 at 09:42:11PM +0100, pancake wrote: >> Use rm -f > > I

Re: [dev] a suckless hex editor

2015-11-13 Thread Greg Reagle
On Fri, Nov 13, 2015 at 07:54:07PM +0100, Nico Golde wrote: > I'm sorry to be blunt, but this is not a suckless hex editor, but a poor mans > hex editor that's barely useful for any real work in my opinion. I mean it > may > work fine for changing a single byte here or there and look at dumps, bu

Re: [dev] a suckless hex editor

2015-11-13 Thread Greg Reagle
On Fri, Nov 13, 2015 at 08:51:24PM +, Connor Lane Smith wrote: > On 13 November 2015 at 20:42, pancake wrote: > > Also, echo is a buildtin, so dont use absolute path for it > > My guess is the path was added because the builtin echo may not > support the -e flag. But that's because it's non-s

Re: [dev] a suckless hex editor

2015-11-13 Thread Greg Reagle
On Fri, Nov 13, 2015 at 09:42:11PM +0100, pancake wrote: > Use rm -f I don't get it. Is this a Unixy geeky way of saying you don't like it?

Re: [dev] a suckless hex editor

2015-11-13 Thread Nico Golde
Hi, * Greg Reagle [2015-11-13 18:33]: > What do you think? I was afraid to overwrite the infile so I make the user > specify an outfile. Maybe if I did better error checking it would be okay > to overwrite? I'm sorry to be blunt, but this is not a suckless hex editor, but a poor mans hex editor

Re: [dev] a suckless hex editor

2015-11-13 Thread Connor Lane Smith
On 13 November 2015 at 20:42, pancake wrote: > Also, echo is a buildtin, so dont use absolute path for it My guess is the path was added because the builtin echo may not support the -e flag. But that's because it's non-standard -- as are all echo flags, really -- and as Dimitris says printf shoul

Re: [dev] a suckless hex editor

2015-11-13 Thread pancake
Also, echo is a buildtin, so dont use absolute path for it > On 13 Nov 2015, at 20:54, Dimitris Papastamos wrote: > >> On Fri, Nov 13, 2015 at 02:52:17PM -0500, Greg Reagle wrote: >> Okay then. It no longer depends on xxd. It depends on od for the hex dump >> (works with both GNU od and sbas

Re: [dev] a suckless hex editor

2015-11-13 Thread pancake
Use rm -f > On 13 Nov 2015, at 20:54, Dimitris Papastamos wrote: > >> On Fri, Nov 13, 2015 at 02:52:17PM -0500, Greg Reagle wrote: >> Okay then. It no longer depends on xxd. It depends on od for the hex dump >> (works with both GNU od and sbase od) and echo, awk, tr, cut for the reverse >> h

Re: [dev] a suckless hex editor

2015-11-13 Thread Dimitris Papastamos
On Fri, Nov 13, 2015 at 02:52:17PM -0500, Greg Reagle wrote: > Okay then. It no longer depends on xxd. It depends on od for the hex dump > (works with both GNU od and sbase od) and echo, awk, tr, cut for the reverse > hex dump. > #!/bin/sh > [ -z "$1" -o -z "$2" ] && { echo "$0 infile outfile";

Re: [dev] a suckless hex editor

2015-11-13 Thread Greg Reagle
Okay then. It no longer depends on xxd. It depends on od for the hex dump (works with both GNU od and sbase od) and echo, awk, tr, cut for the reverse hex dump. #!/bin/sh [ -z "$1" -o -z "$2" ] && { echo "$0 infile outfile"; exit 1; } [ -z "$EDITOR" ] && { echo "\$EDITOR must be defined"; exit

Re: [dev] a suckless hex editor

2015-11-13 Thread pancake
Check ired. From the radare github repo > On 13 Nov 2015, at 19:50, Matthew of Boswell > wrote: > > On Fri, 13 Nov 2015 11:28:36 -0500 > Greg Reagle wrote: > >> What do you think? > > I personally wouldn't use it over hexer, but it's an interesting idea. > > Pros: > - very minimal; great

Re: [dev] a suckless hex editor

2015-11-13 Thread Matthew of Boswell
On Fri, 13 Nov 2015 11:28:36 -0500 Greg Reagle wrote: > What do you think? I personally wouldn't use it over hexer, but it's an interesting idea. Pros: - very minimal; great for embedded (assuming no dependence on vim) Cons: - can't edit the ascii values on the right; everything is parsed from

Re: [dev] a suckless hex editor

2015-11-13 Thread Greg Reagle
On 11/13/2015 12:17 PM, Louis Santillan wrote: tr, bc & awk? Very cool. I'll see what I can do.

Re: [dev] a suckless hex editor

2015-11-13 Thread Louis Santillan
On Fri, Nov 13, 2015 at 8:55 AM, Greg Reagle wrote: > On 11/13/2015 11:45 AM, Alex Pilon wrote: >> >> xxd's provided by vim. As convenient as it is, should a "suckless hex >> editor" really depend on that? It should be the user's choice or not to >> install vim, regardless of anybody's feeling's o

Re: [dev] a suckless hex editor

2015-11-13 Thread Greg Reagle
On 11/13/2015 11:45 AM, Alex Pilon wrote: xxd's provided by vim. As convenient as it is, should a "suckless hex editor" really depend on that? It should be the user's choice or not to install vim, regardless of anybody's feeling's on this list *either* way. Is there another tool that can do a r

Re: [dev] a suckless hex editor

2015-11-13 Thread Alex Pilon
On Fri, Nov 13, 2015 at 11:28:36AM -0500, Greg Reagle wrote: > What do you think? > > […] > > #!/bin/sh > > […] > dump="xxd -g1" > dedump="xxd -r" xxd's provided by vim. As convenient as it is, should a "suckless hex editor" really depend on that? It should be the user's choice or not to install v

Re: [dev] a suckless hex editor

2015-11-13 Thread Greg Reagle
Improved a little. Is it appropriate for inclusion in sbase? #!/bin/sh dump="xxd -g1" dedump="xxd -r" [ -z "$1" -o -z "$2" ] && { echo "$0 infile outfile"; exit 1; } [ -z "$EDITOR" ] && { echo "\$EDITOR must be defined"; exit 1; } tmpfile=$(mktemp) || exit 1 infile="$1" outfile="$2" $dump "$in

[dev] a suckless hex editor

2015-11-13 Thread Greg Reagle
What do you think? I was afraid to overwrite the infile so I make the user specify an outfile. Maybe if I did better error checking it would be okay to overwrite? The user can choose to overwrite by specifying the same file for both infile and outfile. #!/bin/sh [ -z "$1" -o -z "$2" ] &&