help with simple(?) script

Forum rules
Before you post please read how to get help
User avatar
nextdistroplease
Level 1
Level 1
Posts: 37
Joined: Sat Jun 30, 2012 11:18 pm
Location: Lake Elsinore, CA

help with simple(?) script

Postby nextdistroplease » Sun Jul 01, 2012 11:20 pm

I thought it was simple

(I had to post using the "quote" function because the "code" function produces illegible text. I never cared for CSS styles.)

# mount the dvd

udisks --mount /dev/sr1 #1
cd /media #2
ls #3


The script will successfully mount the dvd. (#1)

The script will not even try to change directories. (#2)

The command should be easy enough to interpret. What am I doing wrong?

User avatar
Habitual
Level 12
Level 12
Posts: 4080
Joined: Sun Nov 21, 2010 8:31 pm
Location: Youngstown, Ohio

Re: help with simple(?) script

Postby Habitual » Mon Jul 02, 2012 9:39 am

under "#!/bin/bash" stick in a

Code: Select all

set -x


run the script you have made and watch the extra output.
If you want the things you've never had,
You have to do things you've never done.

User avatar
nextdistroplease
Level 1
Level 1
Posts: 37
Joined: Sat Jun 30, 2012 11:18 pm
Location: Lake Elsinore, CA

Re: help with simple(?) script

Postby nextdistroplease » Wed Jul 04, 2012 9:21 pm

Habitual wrote:under "#!/bin/bash" stick in a

Code: Select all

set -x


run the script you have made and watch the extra output.


Thanks.

Sorry for the slow response.

I'll get on it forthwith,

stratus_ss
Level 4
Level 4
Posts: 270
Joined: Fri May 25, 2012 5:22 pm

Re: help with simple(?) script

Postby stratus_ss » Thu Jul 05, 2012 1:57 pm

you can try sending it to background as well.

For example if I run

Code: Select all

gkrellm -s <ip>
gkrellm -s <ip2>
gkrellm -s <ip3>


On the command line it launches as expected. When I put it in a shell script in never launches ip3. My workaround for that was to put each command to the background

Code: Select all

gkrellm -s <ip> &
gkrellm -s <ip2> &
gkrellm -s <ip3> &


While set -x is much prefered from troubleshooting sometimes there is no useful output produced from it

User avatar
DrHu
Level 17
Level 17
Posts: 7561
Joined: Wed Jun 17, 2009 8:20 pm

Re: help with simple(?) script

Postby DrHu » Thu Jul 05, 2012 2:04 pm

http://forums.fedoraforum.org/showthrea ... ost1510954
--find the data for the udev name/identity(you might not have the full name that is needed?)
https://github.com/jamielinux/bashmount
--one link (script) identified in the first links postings..

User avatar
nextdistroplease
Level 1
Level 1
Posts: 37
Joined: Sat Jun 30, 2012 11:18 pm
Location: Lake Elsinore, CA

Re: help with simple(?) script

Postby nextdistroplease » Fri Jul 06, 2012 3:59 pm

Thank you al for your help.

I am prepared to mark this thread as solved, if there is a way.


Return to “Scripts & Bash”

Who is online

Users browsing this forum: No registered users and 2 guests