D&C Lug - Home Page
Devon & Cornwall Linux Users' Group

[ Date Index ][ Thread Index ]
[ <= Previous by date / thread ] [ Next by date / thread => ]

[LUG] shell scripts



Hi

I am starting to learn shell scripts and have a basic script which just
mounts a cdrom drive,

#!/bin/bash
mount /dev/cdrom /mnt/cdrom
echo cd mounted

I need to add some more error checking but it works,   as I need to su in
order to use the mount command is it possible to pass the root password on
to the su command as part of a script.

I was thinking su <password may work,  but would like something more secure,
like getting the details from /etc/passwd and passing this on,  save a user
having to do it.

thanks

Paul


--
The Mailing List for the Devon & Cornwall LUG
Mail majordomo@xxxxxxxxxxxx with "unsubscribe list" in the
message body to unsubscribe.


Lynx friendly