What am I missing??? [Solved]

Post here if you are a new Porteus member and you're looking for some help.
User avatar
Ed_P
Contributor
Contributor
Posts: 3214
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

What am I missing??? [Solved]

Post#1 by Ed_P » 29 Dec 2014, 21:58

I know my eye sight is going, and probably too my mind :( , but I don't see why this doesn't work.

I have 2 scripts. one a clone of the other. In them I have this piece of code:

Code: Select all

if [ `whoami` != "root" ]; then
    redpswd "Enter root's password"
    su -c "sh $0 $1"
    exit
fi
echo $rst

When I run one script I get:

Code: Select all

guest@porteus:~$ savedatremoveafile.sh
Enter root's password 
Password: 

Enter name of file to remove.

When I run the 2nd one I get:

Code: Select all

guest@porteus:~$ savedatspaceused.sh
./savedatspaceused.sh: line 22: unexpected EOF while looking for matching ``'
./savedatspaceused.sh: line 84: syntax error: unexpected end of file
guest@porteus:~$ 
Line 22 is the top line.

Now some will think the problem is due to lines before line 22, so here are lines 1-22 of the script with the error:

Code: Select all

#!/bin/sh
#  http://forum.porteus.org/viewtopic.php?f=81&t=1941&start=15#p13272
#  http://forum.porteus.org/viewtopic.php?f=117&t=3205&p=25099#p25097

#  mloop requires changes= cheatcodes not used (Always Fresh mode)

BOOTDEV=`grep -A1 "Booting" /var/log/porteus-livedbg|tail -n1|sed 's^//^/^g'`
VERSION=$(cat /etc/porteus-version)
FOLDER=porteus${VERSION:9:3}
GUEST="$BOOTDEV/$FOLDER/Guest"
MODULES="$BOOTDEV/$FOLDER/Modules"`

# Color definitions
txtbld=$(tput bold)               # Bold
txtred=${txtbld}$(tput setaf 1)   # Red
rst=$(tput sgr0)                  # Reset

function redpswd() {
echo -e "$1" $txtred  
}

if [ `whoami` != "root" ]; then
    redpswd "Enter root's password"
    su -c "sh $0 $1"
    exit
fi
echo $rst
And the similar group from the script that works:

Code: Select all

#!/bin/sh 
# http://forum.porteus.org/viewtopic.php?f=81&t=3501&p=25182#p25178
# http://forum.porteus.org/viewtopic.php?f=81&t=3501&p=25151#p25162
# http://forum.porteus.org/viewtopic.php?f=81&t=3501&p=25151#p25178

# mloop requires changes= cheatcodes not be used (Always Fresh mode)

BOOTDEV=`grep -A1 "Booting" /var/log/porteus-livedbg|tail -n1|sed 's^//^/^g'`
VERSION=$(cat /etc/porteus-version)
FOLDER=porteus${VERSION:9:3}
GUEST="$BOOTDEV/$FOLDER/Guest"
MODULES="$BOOTDEV/$FOLDER/Modules"

# Color definitions
txtbld=$(tput bold)               # Bold
txtred=${txtbld}$(tput setaf 1)   # Red
rst=$(tput sgr0)                  # Reset

function redpswd() {
echo -e "$1" $txtred  
}

if [ `whoami` != "root" ]; then
    redpswd "Enter root's password"
    su -c "sh $0 $1"
    exit
fi
echo $rst
As said the scripts are clones.

And for the concern as to the working script's name, it is only used to fix deleted files whose name contains a blank.

The script with the error has worked in the past and I was surprised to encounter the error today, which adds to my confusion.
Last edited by Ed_P on 30 Dec 2014, 17:29, edited 1 time in total.
Ed

Bogomips
Full of knowledge
Full of knowledge
Posts: 2562
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: What am I missing???

Post#2 by Bogomips » 29 Dec 2014, 23:05

Message does not seem to make sense: line 22: unexpected EOF while looking for matching ``'

End bit: ``'
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

User avatar
phhpro
Full of knowledge
Full of knowledge
Posts: 545
Joined: 10 Nov 2013, 20:35
Distribution: .

Re: What am I missing???

Post#3 by phhpro » 30 Dec 2014, 02:11

...
Last edited by phhpro on 04 Feb 2016, 02:08, edited 1 time in total.

User avatar
Ed_P
Contributor
Contributor
Posts: 3214
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: What am I missing???

Post#4 by Ed_P » 30 Dec 2014, 06:46

Bogomips wrote:Message does not seem to make sense:
I know!!
phhpro wrote:Any chance you copy/pasted the file? /quote]
No, I opened the original and changed it to make the clone. And I have several that start similarly.
This single quote ` is not equal to this '
Where are you seeing this????
Ed

User avatar
wread
Module Guard
Module Guard
Posts: 1080
Joined: 09 Jan 2011, 18:48
Distribution: Porteus v3.2.5-kde5-64 bits
Location: Santo Domingo
Contact:

Re: What am I missing???

Post#5 by wread » 30 Dec 2014, 13:51

You made a typo: it reads redpswd, shouldn' t it be readpswd?
Porteus is proud of the FASTEST KDE ever made.....(take akonadi, nepomuk and soprano out and you will have a decent OS).
The Porteus Community never sleeps!

Bogomips
Full of knowledge
Full of knowledge
Posts: 2562
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: What am I missing???

Post#6 by Bogomips » 30 Dec 2014, 14:54

Ed, if you are not using an editor with shell script highlighting, it might pay to use one like kwrite, which could then point out, what might have gone amiss.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

User avatar
Ed_P
Contributor
Contributor
Posts: 3214
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: What am I missing???

Post#7 by Ed_P » 30 Dec 2014, 17:25

FOUND IT!!! :Yahoo!:

In the script not working it had, on line 11 not line 22, :

Code: Select all

MODULES="$BOOTDEV/$FOLDER/Modules"`
rather than

Code: Select all

MODULES="$BOOTDEV/$FOLDER/Modules"
How that trailing character got there I have NO idea. How I missed it is easy, it looks like a spec of DUST on my screen.

Thanks for your help guys, I appreciate it. :friends:

BTW "redpswd" is for setting the password prompt red, not reading the password. :) And I will look into getting kwrite.

Thanks again. :beer:
Ed

Bogomips
Full of knowledge
Full of knowledge
Posts: 2562
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: What am I missing???

Post#8 by Bogomips » 30 Dec 2014, 22:37

Ed_P wrote:And I will look into getting kwrite.
Kwrite is stock KDE. Just switch desktops. Need 003-kde.xzm in porteus/optional, then restart with noload=razorqt load=3-kde, the (quick and dirty?) way I'm doing it at the moment, but then am running always fresh.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

User avatar
Ed_P
Contributor
Contributor
Posts: 3214
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: What am I missing??? [Solved]

Post#9 by Ed_P » 31 Dec 2014, 07:22

Thanks Bogomips. I tried switchin to KDE to try it but failed. I keep getting an xterm error about not finding a font. The noload option is working the problem is with the load cheatcode.

Code: Select all

title Porteus 3.0.1 extramod= KDE \n213MB\n %ISO30% 
find --set-root                       /ISOs/%ISO30%
map --heads=0 --sectors-per-track=0   /ISOs/%ISO30% (0xff) 
map --hook
root (0xff)
kernel /boot/syslinux/vmlinuz    from=/ISOs/%ISO30% extramod=/porteus3.0/Modules;/porteus3.0/modsavedat volume=33 noload=razor load=/porteus3.0/Optional/kde
initrd /boot/syslinux/initrd.xz
And

Code: Select all

set ISO30=Porteus-RazorQT-v3.0.1-x86_64.iso
And

Code: Select all

guest@porteus:~$ ls -ghlst /mnt/sda5/porteus3.0/Optional/
total 252M
68M -rwxrwxrwx 1 root 68M Nov  4 19:27 003-kde.xzm*
73M -rwxrwxrwx 2 root 73M Nov  4 19:16 003-razor.xzm*
21M -rwxrwxrwx 1 root 21M Jul  8 20:20 003-lxde.xzm*
27M -rwxrwxrwx 1 root 27M Jun 29 18:51 003-xfce.xzm*
66M -rwxrwxrwx 1 root 66M Jun 28 09:28 003-mate.xzm*
guest@porteus:~$ 
Ed

Bogomips
Full of knowledge
Full of knowledge
Posts: 2562
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: What am I missing??? [Solved]

Post#10 by Bogomips » 31 Dec 2014, 12:12

Ed, try load=3-kde as suggested ;)
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

User avatar
Ed_P
Contributor
Contributor
Posts: 3214
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: What am I missing??? [Solved]

Post#11 by Ed_P » 31 Dec 2014, 16:32

Oh I tried that and numerous other variations all with the same result. I suspect the load cheatcode doesn't like my location for the alternate desktops. I suppose I could put them all in my Modules directory and then use only the noload cheatcode. noload=razor;lxde;mate;etc. to select one.

And I did read the documentation on the use of the load= cheatcode on Cheatcodes - what they are and how to use them Image
Ed

Bogomips
Full of knowledge
Full of knowledge
Posts: 2562
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: What am I missing??? [Solved]

Post#12 by Bogomips » 31 Dec 2014, 17:06

Ed_P wrote:I suspect the load cheatcode doesn't like my location for the alternate desktops.
Works for me with porteus/optional. All lower case. Don't know if porteus3.0/modules would work. If it does, then porteus3.0/optional should work.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

User avatar
Ed_P
Contributor
Contributor
Posts: 3214
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: What am I missing??? [Solved]

Post#13 by Ed_P » 31 Dec 2014, 18:06

Bogomips wrote: Don't know if porteus3.0/modules would work. If it does, then porteus3.0/optional should work.
It doesn't which is why I use the capital M. I suspect the same applies for "optional".

See viewtopic.php?f=53&t=3801&p=28494&hilit ... les#p28494.
Ed

Bogomips
Full of knowledge
Full of knowledge
Posts: 2562
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: What am I missing??? [Solved]

Post#14 by Bogomips » 31 Dec 2014, 18:40

load=module
load=module[1];module[n]

... Load optional modules from /optional/ directory on the booting
media. Additional modules can be listed, separated
by semicolons, without spaces.
Exampe: 'load=gimp;inkscape' would search for and load any
modules in the /porteus/optional folder that contain the strings
'gimp' or 'inkscape'.
Looks like this will only work if you have a /porteus/optional available. If you can't then it's worth trying
Ed_P wrote: noload=razor;lxde;mate;etc. to select one.
and not getting sidetracked. :Search:
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

Bogomips
Full of knowledge
Full of knowledge
Posts: 2562
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: What am I missing??? [Solved]

Post#15 by Bogomips » 05 Jan 2015, 17:46

Ed, been mulling over your problem, tried a different approach, and see no reason why it should not work in your case.
  • Boot into text mode

    Code: Select all

    guest@porteus:~$ dmesg|grep command
    [    0.000000] Kernel command line: quiet copy2ram ramsize=30% noauto timezone=Europe/London volume=60% noload=xorg;kde autoexec=telinit-3
    
    Got landed in xterm when using just: noload=kde and autoexec=telinit-3, although according to that link, the only pertinent link turning up in search, it should have been Runlevel 3.
    • Then as root

      Code: Select all

      # init 3
      # activate /<Path to>/002-xorg.xzm
      # activate /<Path to>/003-mate.xzm
      # init 4
      
      loop0     7:0    0    16M  0 loop /mnt/live/memory/images/000-kernel.xzm
      loop1     7:1    0    46M  0 loop /mnt/live/memory/images/001-core.xzm
      loop2     7:2    0     4K  0 loop /mnt/live/memory/images/0099-settings.xzm
      loop3     7:3    0  29.2M  0 loop /mnt/live/memory/images/nVidia-304.123-porteus
      loop4     7:4    0   528K  0 loop /mnt/live/memory/images/sudo-1.8.9p5-i486-1.xz
      loop5     7:5    0  43.7M  1 loop /mnt/live/memory/images/002-xorg.xzm
      loop6     7:6    0  56.5M  1 loop /mnt/live/memory/images/003-mate.xzm
      
    Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
    NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

    Post Reply