install-quirky-to-drive.sh echo problem

Please post any bugs you have found
Post Reply
Message
Author
linuxbass
Posts: 3
Joined: Sun 02 Nov 2014, 19:53

install-quirky-to-drive.sh echo problem

#1 Post by linuxbass »

The command interpreter for this script is bourne shell #!/bin/sh. Ubuntu links /bin/sh to dash. Echo is used in this script and since there is no exectuable set for echo the builtin is used.

The echo built-in command for the dash interpreter does not have provision for the -e flag. Thus - e gets piped to fdisk during for drive partitioning statements and drive fails to be partitioned correctly.

Statements such as the bellow fail because "-" and "e" get piped to fdisk instead of just o w and n. Also the carriage returns are not sent either since the -e flag is not valid for the dash built-in echo.

echo -e 'o\nw\n' | fdisk /dev/${TARGETDRIVE} > /tmp/installquirkyfdisk.log 2>&1

two simple fixes are to use /bin/echo or just change the command interpreter to bash which seems to be the easiest fix for this problem. Script runs successfully in Ubuntu 14.04 LTS xterm using #!/bin/bash for command interpreter.

-Linuxbass

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#2 Post by BarryK »

I don't read all of the Forum posts, mostly only monitoring this thread for Quirky feedback:

http://murga-linux.com/puppy/viewtopic. ... 725#806725

...the reply to your question is there.
[url]https://bkhome.org/news/[/url]

linuxbass
Posts: 3
Joined: Sun 02 Nov 2014, 19:53

How to submit fix?

#3 Post by linuxbass »

Hi All, I'm new around here so not sure how to alert Barry about this bug and fix I've proposed.

Thanks,
~Linuxbass

linuxbass
Posts: 3
Joined: Sun 02 Nov 2014, 19:53

Re: How to submit fix?

#4 Post by linuxbass »

linuxbass wrote:Hi All, I'm new around here so not sure how to alert Barry about this bug and fix I've proposed.

Thanks,
~Linuxbass
Thanks Barry, I must have been writing this question while you were responding. Cheers and thanks for the info.

Yea good fix using `which echo` since it's tough to be certain where an echo binary might be on any given system.

cheers!

~Linuxbass

Post Reply