PDA

View Full Version : Help with shell script + startup



niXnoob
10-05-2004, 07:37 AM
I need help writing a simple script, I need it first to mount a USB stick for reading and writing, then I need it to copy some files from the machines hard drive on to the usb stick.

Also I need to add this file on to a knoppix cd image file and get it to automatically run when knoppix boots.

Is this possible and can any one help?

thanks

UnderScore
10-05-2004, 05:29 PM
I don't have a usb drive so I will guess at the commands

mkdir /mnt/sda1
mount -t ntfs -o ro /dev/hda1 /mnt/hda1 && mount -t vfat /dev/sda1 /mnt/sda1 && cp -pv /mnt/hda1/somefolder/somefile /mnt/sda1

Anyhow, the script for mounting & copying files is a simple task compared to making your own knoppix CD. I suggest that you look at my HOWTO in the remastering & customization forum HOWTO: James's remaster method using Fabian's remaster-menu (http://www.knoppix.net/forum/viewtopic.php?t=13867). On the remaster, you could edit the /etc/X11/Xsession.d/45xsession script to call your script. 45xession is executed after the hardware detection is complete and right before knoppix starts X and brings up KDE. It controls how the /home/knoppix folder gets populated at each bootup.
I hope this helps.
James

bob58
10-05-2004, 11:43 PM
Wow....maybe you UNDERSCORE can help me with some scripting. I posted a message on a Linux scripting board and no one has replied so I am wondering. I need help learning scripts that display text files and how to make a menu giving choices of those text files....all to run in Konsole or on a command line only machine....I am wanting to do what I like doing in DOS, but trying to do it in LINUX....bob

niXnoob
10-06-2004, 04:56 AM
:D thanks mate