LINUX LITE 7.2 FINAL RELEASED - SEE RELEASE ANNOUNCEMENTS SECTION FOR DETAILS


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Program error
#1
Hello,

this is the script -

[Image: menu-driven.png]

this is the error message on option 3 only


[Image: menu-driven2.png]


I set the shell script permissions to -

Code:
chmod 755

As it was what the book specified to use in the first chapter of the shell scripting chapters.

I checked the "18G..." results with error , by changing lines #33 and #36 by adding

Code:
sudo

the program produces no error, but of course it needs the password to be typed, this confirmed the results of "18G...", as correct. In that the script, as in screenshot above, has the permission denied error but is producing the correct results shown on the next line in the terminal after the error, on the screenshot above.

Options 1, 2, and 0 work without any errors in the program.
The only changes I have made to the script from the book is to beautify the code alignment to my liking.
The error happens before this when run, and still does, so it has not affected the programs functioning.

I would like some help as to how to run this script on option3 without it producing the error.
Reply
#2
[member=411]bitsnpcs[/member]
I was playing with the du command in my terminal and could replicate a permissions error - although not the same file as you...
using 'du -sh /home' or 'du -sh /home/*'

What did yield the results without error was 'du -sh ~'
Code:
du -sh ~

May be worth a try in your script... ??? ...
- Also I'd be curious to the top 14 lines of your script - looks like a nice piece of coding Smile

Hope it helps!!!


*** Sorry ~ shows your home directory only.. Missed the need for "others/all users"  got caught up playing LOL ****


***2nd Edit - Although your error is in your own home, perhaps permissions are pooched on your files? See this link  ***
https://askubuntu.com/questions/863042/p...nd-command
To make your user owner of the files in your home directory


Good Luck
LL4.8 UEFI 64 bit ASUS E402W - AMD E2 (Quad) 1.5Ghz  - 4GB - AMD Mullins Radeon R2
LL5.8 UEFI 64 bit Test UEFI Kangaroo (Mobile Desktop) - Atom X5-Z8500 1.44Ghz - 2GB - Intel HD Graphics
LL4.8 64 bit HP 6005- AMD Phenom II X2 - 8GB - AMD/ATI RS880 (HD4200)
LL3.8 32 bit Dell Inspiron Mini - Atom N270 1.6Ghz - 1GB - Intel Mobile 945GSE Express  -- Shelved
BACK LL5.8 64 bit Dell Optiplex 160 (Thin) - Atom 230 1.6Ghz - 4GB-SiS 771/671 PCIE VGA - Print Server
Running Linux Lite since LL2.2
Reply
#3
[member=5414]firenice03[/member] here are the top 14 lines and onwards a bit


[Image: menudriven3.png]

Thank You I will give these a try Smile
Just looking at edit 2


Reply
#4
[member=5414]firenice03[/member] 2nd Edit has solved it , thank you  8)

Option 0 screenshot

[Image: Screenshot-2019-02-15-20-24-42.png]

Option 1, 2, 3 , and a screenshot showing the error message for a number entered outside of the 0-3 options.

[Image: menudriven5.png]
Reply
#5
[member=411]bitsnpcs[/member] cool glad it helped, yeah I might mimic that script of yours Smile
LL4.8 UEFI 64 bit ASUS E402W - AMD E2 (Quad) 1.5Ghz  - 4GB - AMD Mullins Radeon R2
LL5.8 UEFI 64 bit Test UEFI Kangaroo (Mobile Desktop) - Atom X5-Z8500 1.44Ghz - 2GB - Intel HD Graphics
LL4.8 64 bit HP 6005- AMD Phenom II X2 - 8GB - AMD/ATI RS880 (HD4200)
LL3.8 32 bit Dell Inspiron Mini - Atom N270 1.6Ghz - 1GB - Intel Mobile 945GSE Express  -- Shelved
BACK LL5.8 64 bit Dell Optiplex 160 (Thin) - Atom 230 1.6Ghz - 4GB-SiS 771/671 PCIE VGA - Print Server
Running Linux Lite since LL2.2
Reply
#6
[member=5414]firenice03[/member] that would be  8) Smile

This is the Gedit template I use - https://gist.github.com/LeoIannacone/710...e04567d77e

Reply
#7
[member=411]bitsnpcs[/member]

So I tweaked it a little, it will run in a loop until 0 = quit or an invalid is chosen.
So you can run each without restarting the script.

Thanks for posting it gave me something to play with LOL

I was wondering what you used to edit - I used Geany on my LL box, I use Atom at work for mostly Ruby (still a newbie to it)..
If you're curious - They both allow you have switch between files in tabs - Atom will show your directory tree, where I have files that reference other files I can switch around and still know where I'm at Smile

Here's the modifications.. Minor tweaks (I added some spacing for visual)... All other lines are the same (moved 0 to the bottom so I could think it thru Smile )

  [Image: 3B9G9zBl.png]

LL4.8 UEFI 64 bit ASUS E402W - AMD E2 (Quad) 1.5Ghz  - 4GB - AMD Mullins Radeon R2
LL5.8 UEFI 64 bit Test UEFI Kangaroo (Mobile Desktop) - Atom X5-Z8500 1.44Ghz - 2GB - Intel HD Graphics
LL4.8 64 bit HP 6005- AMD Phenom II X2 - 8GB - AMD/ATI RS880 (HD4200)
LL3.8 32 bit Dell Inspiron Mini - Atom N270 1.6Ghz - 1GB - Intel Mobile 945GSE Express  -- Shelved
BACK LL5.8 64 bit Dell Optiplex 160 (Thin) - Atom 230 1.6Ghz - 4GB-SiS 771/671 PCIE VGA - Print Server
Running Linux Lite since LL2.2
Reply
#8
[member=5414]firenice03[/member]

Smile Good modifications.

I haven't learned these yet, loops are in the next chapter, I learn from the book etc.

Yes I use Gedit on Linux Lite for learning Python, and also learning Shell Scripting as it is the final part of the command line book (Chapters #24 thru #36[end of the book]), I have just completed chapter #28, I've been on this book for a long time maybe 3 or 4 years lol
I have just added the template to Gedit in Ubuntu on Saturday, I couldn't add the template in Gnome myself, one of the Ubuntu Moderators showed me how to do it. I also had to ask how to add the template the first time on Linux Lite.

On Linux Lite I have also used Leafpad for editing code of files already on the system, or files in Virtualbox when I used to use it, just a couple of times, I also use Leafpad for lists some times, in the same way I used to use textpad in Windows in the past.

I just try and learn code at home.
At the weekend I heard about womens mentoring programmes, so I began to look if they exist for Linux, I have to learn more about them and see if there are any suitable for me, or whether I need to learn a lot more first before I would be able to join it, as it may begin at too advanced a level for me to be able to learn on it.
Reply
#9
[member=411]bitsnpcs[/member]
Take your time... You're doing great Smile
I wish I had the time to fully learn it, more so trial by fire and learn as you go..
I know enough to get into trouble, and hopefully enough to get back out... But can poke around to get what I need...


8) 8) 8)
LL4.8 UEFI 64 bit ASUS E402W - AMD E2 (Quad) 1.5Ghz  - 4GB - AMD Mullins Radeon R2
LL5.8 UEFI 64 bit Test UEFI Kangaroo (Mobile Desktop) - Atom X5-Z8500 1.44Ghz - 2GB - Intel HD Graphics
LL4.8 64 bit HP 6005- AMD Phenom II X2 - 8GB - AMD/ATI RS880 (HD4200)
LL3.8 32 bit Dell Inspiron Mini - Atom N270 1.6Ghz - 1GB - Intel Mobile 945GSE Express  -- Shelved
BACK LL5.8 64 bit Dell Optiplex 160 (Thin) - Atom 230 1.6Ghz - 4GB-SiS 771/671 PCIE VGA - Print Server
Running Linux Lite since LL2.2
Reply
#10
[member=5414]firenice03[/member]
I think you know Linux very well Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)