LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-01-2004, 01:59 PM   #1
EuroJovi
Member
 
Registered: Oct 2003
Location: Mobile, AL
Distribution: Debian, Knoppix, Mandrake 9.1, Ubuntu
Posts: 49

Rep: Reputation: 15
Simple script writing help - digital camera


In my quest of learning linux, I am now getting into writing scripts. I wrote the following script to automatically download and sort my digital pictures from my camera to my hard drive:

#! /bin/sh

echo -n "Plug camera into computer and press enter when ready to continue"
read
echo -n "What would you like to name the directory? (NO SPACES) > "
read dirname
mkdir /home/troy/Pictures/$dirname/
mount /mnt/camera
mv /mnt/camera/dcim/100olymp/*.jpg /home/troy/Pictures/$dirname/
cd /home/troy/Pictures/$dirname
umount /mnt/camera
echo -n "Remove camera from computer and press enter"
read
konqueror /home/troy/Pictures/$dirname
exit

It works perfect in xterm; however, I would like it to run if i just clicked on it from within KDE. What I mean, is that I would like it to load up an xterm window, then run the script within that window. Is there a simple line to add that will do this?

Thanks!

Troy
 
Old 02-01-2004, 02:58 PM   #2
Artimus
Member
 
Registered: Feb 2003
Location: Wisconsin
Distribution: Slackware
Posts: 188

Rep: Reputation: 30
Okay, this is assuming that your script is called camera.sh. Change that part to reflect what you called it

xterm -e /path/to/camera.sh

EDIT: Forgot to add. You just create a shortcut on your desktop and use what I put above as the command that it will execute.

Last edited by Artimus; 02-01-2004 at 02:59 PM.
 
Old 02-01-2004, 04:01 PM   #3
EuroJovi
Member
 
Registered: Oct 2003
Location: Mobile, AL
Distribution: Debian, Knoppix, Mandrake 9.1, Ubuntu
Posts: 49

Original Poster
Rep: Reputation: 15
Works beautifully! Thanks a ton!

Troy
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing a simple auto-reconect script for KInternet in SUSE 9.3 tomazN Linux - Networking 0 07-11-2005 10:21 AM
Digital Camera jnicou Mandriva 1 05-21-2005 03:38 PM
Help writing a simple script Garibaldi3489 Linux - General 10 12-18-2004 06:22 PM
Digital Camera matt3333 Slackware 4 10-05-2003 09:49 PM
Digital Camera Mike Blick Linux - Hardware 1 05-28-2002 01:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration