??? What happened? How? [Solved]

Technical issues/questions of an intermediate or advanced nature.
User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

??? What happened? How? [Solved]

Post#1 by Ed_P » 27 Jul 2019, 18:43

I created a simple script while on Porteus 4.0. One similar to others I've created that run without problems.

wine.sh

Code: Select all

#!/bin/sh

OPTIONAL="/mnt/sda6/porteus5.0/Optional/wine"
WINE="wine*.xzm"
LIBS="0050*.xzm"

echo guest | sudo -S activate $OPTIONAL/$WINE  $OPTIONAL/$LIBS > /dev/null 2>&1 &

sleep 3
echo "RIGHT click .exe files to run via Wine."
But when I run it on Porteus 5.0rc1 I get:

Code: Select all

/mnt/sda6/porteus5.0/wine.sh: line 7: $'\r': command not found
/mnt/sda6/porteus5.0/wine.sh: line 8: $'\r': command not found
sleep: invalid time interval ‘3\r’
Try 'sleep --help' for more information.
RIGHT click .exe files to run via Wine.
line 8 command!! :o Line 8 is blank.

$'\r' commands?? :unknown:

What happened and how do I fix it??


-update-

Good grief!! The quote marks were the cause. This works.

Code: Select all

#!/bin/sh

OPTIONAL=/mnt/sda6/porteus5.0/Optional/wine
WINE=wine*.xzm
LIBS=0050*.xzm

echo guest | sudo -S activate $OPTIONAL/$WINE  $OPTIONAL/$LIBS > /dev/null 2>&1 &

sleep 3
echo "RIGHT click .exe files to run via Wine."
Some things require quotes and some things don't. :crazy:
Ed

burdi01
Shogun
Shogun
Posts: 201
Joined: 18 Aug 2013, 12:09
Distribution: Slackware PartedMagic Xubuntu
Location: The Netherlands

??? What happened? How? [Solved]

Post#2 by burdi01 » 28 Jul 2019, 08:52

Looks like https://superuser.com/questions/489180/ ... ash-script ...
When removing the double quotes you seem to have removed the CRs as well.
:D

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

??? What happened? How? [Solved]

Post#3 by Ed_P » 28 Jul 2019, 13:40

Thank you burdi01. :) Apparently I created the file while in Windows not in Porteus 4.0. :fool:
Ed

Post Reply