help with simple(?) script

Forum rules
Before you post please read how to get help

help with simple(?) script

Postby nextdistroplease on 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
nextdistroplease
Level 1
Level 1
 
Posts: 37
Joined: Sat Jun 30, 2012 11:18 pm
Location: Lake Elsinore, CA

Linux Mint is funded by ads and donations.
 

Re: help with simple(?) script

Postby Habitual on 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.
What's a landing but a take off in reverse?
User avatar
Habitual
Level 8
Level 8
 
Posts: 2254
Joined: Sun Nov 21, 2010 8:31 pm
Location: LM17Q-Xfce

Re: help with simple(?) script

Postby nextdistroplease on 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,
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 stratus_ss on 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
stratus_ss
Level 4
Level 4
 
Posts: 270
Joined: Fri May 25, 2012 5:22 pm

Re: help with simple(?) script

Postby DrHu on 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
DrHu
Level 17
Level 17
 
Posts: 7037
Joined: Wed Jun 17, 2009 8:20 pm

Re: help with simple(?) script

Postby nextdistroplease on 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.
User avatar
nextdistroplease
Level 1
Level 1
 
Posts: 37
Joined: Sat Jun 30, 2012 11:18 pm
Location: Lake Elsinore, CA


Return to Scripts & Bash

Who is online

Users browsing this forum: No registered users and 1 guest