New topic: Shelling out a sudo command.
<http://forums.realsoftware.com/viewtopic.php?t=47650> Page 1 of 1 [ 5 posts ] Previous topic | Next topic Author Message BrianOBrien Post subject: Shelling out a sudo command.Posted: Fri Apr 19, 2013 10:33 pm Joined: Wed Jul 07, 2010 2:55 pm Posts: 675 Location: University Of Calgary, Faculty Of Medicine I'm trying to run a unix command that requires root permission. egsudo dd if=x.img of=/dev/rdisk1 But of course the shell doesn't have a method of asking admin's password so this fails. What do I do? _________________ If at first you don't succeed... Try REALBasic. Top J.Hansen Post subject: Re: Shelling out a sudo command.Posted: Sat Apr 20, 2013 4:35 am Joined: Wed Dec 14, 2011 4:20 am Posts: 74 BrianOBrien wrote:I'm trying to run a unix command that requires root permission. egsudo dd if=x.img of=/dev/rdisk1 But of course the shell doesn't have a method of asking admin's password so this fails. What do I do? Have you tried this: echo YourSudoPassword | sudo -S "dd if=x.img of=/dev/rdisk1" Info: http://developer.apple.com/library/mac/ ... udo.8.html Top BrianOBrien Post subject: Re: Shelling out a sudo command.Posted: Sat Apr 20, 2013 1:10 pm Joined: Wed Jul 07, 2010 2:55 pm Posts: 675 Location: University Of Calgary, Faculty Of Medicine yes and it works! If I use an async shell. however dd isn't very verbose.... So there is no concept of time to completion... The user just waits... _________________ If at first you don't succeed... Try REALBasic. Top p0wn3d Post subject: Re: Shelling out a sudo command.Posted: Sat Apr 20, 2013 1:20 pm Joined: Sun Oct 28, 2012 4:54 am Posts: 206 Location: Herts, UK I use dcfldd instead has several options including verbose output etc.. http://dcfldd.sourceforge.net/ _________________ Real Studio 2012 R2 SysInfo BackTrack Linux/BackBox Linux/Debian Lenny/Windows 7/Windows 8/OpenWRT/OpenBSD & Yes it's me in the Avatar Top BrianOBrien Post subject: Re: Shelling out a sudo command.Posted: Sat Apr 20, 2013 1:48 pm Joined: Wed Jul 07, 2010 2:55 pm Posts: 675 Location: University Of Calgary, Faculty Of Medicine Correct me if I'm wrong but can I not just open the raw unix device and write to it in binary mode? /dev/rdisk1 _________________ If at first you don't succeed... Try REALBasic. Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 5 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
