From: Folderol on 12 Mar 2010 05:26 The script below works perfectly in bash, but if I try to run it on a system with dash I get the following error: Start_Midisport.sh: 21: [[: not found Can anyone suggest what I should do to get it to work equally well in either shell? #!/bin/bash # echo's can be removed -just for testing name="MidiSport" lsusb | cat | while read line do if [[ "$line" =~ "$name" ]] then echo $line result=${line#'Bus '} busnumber=${result%' Device'*} result=${result#*'Device '} devicenumber=${result%': ID'*} echo $busnumber echo $devicenumber result="sudo fxload -I /usr/local/share/usb/maudio/MidiSport2x2.ihx -D /dev/bus/usb/"$busnumber"/"$devicenumber echo $result exec $result fi done echo -- Will J G
From: Chris Davies on 12 Mar 2010 10:23 Folderol <folderol(a)ukfsn.org> wrote: > The script below works perfectly in bash, but if I try to run it on a > system with dash I get the following error: > Start_Midisport.sh: 21: [[: not found > Can anyone suggest what I should do to get it to work equally well in > either shell? How do you run it (the exact command, please)? Chris
From: Folderol on 12 Mar 2010 11:33 On Fri, 12 Mar 2010 15:23:22 +0000 Chris Davies <chris-usenet(a)roaima.co.uk> wrote: > Folderol <folderol(a)ukfsn.org> wrote: > > The script below works perfectly in bash, but if I try to run it on a > > system with dash I get the following error: > > > Start_Midisport.sh: 21: [[: not found > > > Can anyone suggest what I should do to get it to work equally well in > > either shell? > > How do you run it (the exact command, please)? > Chris As an embedded desktop command: sh Start_Midisport.sh but when testing, in a terminal either: bash Start_Midisport.sh or: dash Start_Midisport.sh -- Will J G
From: unruh on 12 Mar 2010 11:55 On 2010-03-12, Folderol <folderol(a)ukfsn.org> wrote: > On Fri, 12 Mar 2010 15:23:22 +0000 > Chris Davies <chris-usenet(a)roaima.co.uk> wrote: > >> Folderol <folderol(a)ukfsn.org> wrote: >> > The script below works perfectly in bash, but if I try to run it on a >> > system with dash I get the following error: >> >> > Start_Midisport.sh: 21: [[: not found >> >> > Can anyone suggest what I should do to get it to work equally well in >> > either shell? [[ is an internal command in bash. I guess it is not in dash. complain to the writers of dash.
From: Richard Kettlewell on 12 Mar 2010 12:11 unruh <unruh(a)wormhole.physics.ubc.ca> writes: > On 2010-03-12, Folderol <folderol(a)ukfsn.org> wrote: >> On Fri, 12 Mar 2010 15:23:22 +0000 >> Chris Davies <chris-usenet(a)roaima.co.uk> wrote: >> >>> Folderol <folderol(a)ukfsn.org> wrote: >>> > The script below works perfectly in bash, but if I try to run it on a >>> > system with dash I get the following error: >>> >>> > Start_Midisport.sh: 21: [[: not found >>> >>> > Can anyone suggest what I should do to get it to work equally well in >>> > either shell? > > [[ is an internal command in bash. I guess it is not in dash. > complain to the writers of dash. It's a Bashism, i.e. not a standard (in the POSIX sense) shell feature. -- http://www.greenend.org.uk/rjk/
|
Next
|
Last
Pages: 1 2 3 4 Prev: Skype can't see working Webcam Next: Problem installing collabtive on LAMP server |