So what is the difference between our scripts?
su -c 'sh $0'
su -c "sh $0"
EDIT:
http://linuxcommand.org/wss0060.php
??? What am I missing?? Newbie scripting err. (Solved)
- brokenman
- Site Admin
- Posts: 6104
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
- Contact:
Re: ??? What am I missing?? Newbie scripting err. (Solved)
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.
- Ed_P
- Contributor
- Posts: 7671
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.0 ISO
- Location: Western NY, USA
Re: ??? What am I missing?? Newbie scripting err. (Solved)
brokenman wrote:So what is the difference between our scripts?
su -c 'sh $0'
su -c "sh $0"

Well, one script used copy and paste from what you posted
the other cheated and apparently searched the web for how to do it.brokenman wrote:In that case it would be something like: su - -c 'sh $0'

I should have used the new command that I saw recently.
Code: Select all
guest@porteus:~$ diff testY.sh testX.sh
4c4
< su -c 'sh $0'
---
> su -c "sh $0"
guest@porteus:~$
An interesting read. Thanks.brokenman wrote:http://linuxcommand.org/wss0060.php
Ed
- brokenman
- Site Admin
- Posts: 6104
- Joined: 27 Dec 2010, 03:50
- Distribution: Porteus v4 all desktops
- Location: Brazil
- Contact:
Re: ??? What am I missing?? Newbie scripting err. (Solved)
Yes, sorry. I often get caught out by quotes in scripts. The first one failed and I immediately suspected the variable inside single quotes.Well, one script used copy and paste from what you posted
How do i become super user?
Wear your underpants on the outside and put on a cape.
Wear your underpants on the outside and put on a cape.