open shell as root, execute and close

I need to execute a command as root (such halt command) then return to by normal shell. How ??
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Provided your singol command is not a shell script (csh,sh,perl), you can

1)first change the owner of singol to root

chown root singol

2)then do a setuid, so that whoever execute that file is in effect running it as root:

chmod u+s singol

su root -c singol
ozo's comment is more to the point, on 2nd thought.
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

sfenatiAuthor Commented:
Edited text of question.
su root -c /etc/halt

(but if you halt the machine, how can you return to your shell?)
I think ozo got it already, but you may need to use single quotes to inhibit shell evalution of the command to be executed.  For instance, mounting a floppy using the mount command required root priviledge:

su -c 'mount -t vfat /dev/fd0 /mnt/floppy'

You'll be prompted for the root password.  After the command executes you'll be back to an ordinary user session.  (Note: the sample command above will cause all the files on the floppy to be owned by root...not very can use usermount instead, but you may have to edit /etc/fstab)

best of luck to you!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.