[SOLVED] Usb Script that works in F29 but not F30
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2010
    Location
    los an
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Usb Script that works in F29 but not F30

    This Script prints usb assignments F29 not F30
    #!/bin/bash

    for sysdevpath in $(find /sys/bus/usb/devices/usb*/ -name dev); do
    (
    syspath="${sysdevpath%/dev}"
    devname="$(udevadm info -q name -p $syspath)"
    [[ "$devname" == "bus/"* ]] && continue <-----Line 7
    eval "$(udevadm info -q property --export -p $syspath)"
    [[ -z "$ID_SERIAL" ]] && continue <------ Line 9
    echo "/dev/$devname - $ID_SERIAL"
    )
    done

    ------------------------------------------------------------------------------
    Output -

    [stevef@pita-24 UsbStuff]$ ./fndusb
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/001/001 - Linux_5.2.9-200.fc30.x86_64_ehci_hcd_EHCI_Host_Controller_0000 :00:1a.0
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/001/002 - 8087_800a
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/002/002 - 8087_8002
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/002/001 - Linux_5.2.9-200.fc30.x86_64_ehci_hcd_EHCI_Host_Controller_0000 :00:1d.0
    /dev/ttyUSB3 - Prolific_Technology_Inc._USB-Serial_Controller_D
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/003/010 - Prolific_Technology_Inc._USB-Serial_Controller_D
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/003/005 - 05e3_USB2.0_Hub
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/003/008 - Prolific_Technology_Inc._USB-Serial_Controller_D
    /dev/ttyUSB2 - Prolific_Technology_Inc._USB-Serial_Controller_D
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/003/003 - Corsair_Corsair_STRAFE_RGB_Gaming_Keyboard_0301D01 8AEBD18415618CA5DF5001944
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/003/001 - Linux_5.2.9-200.fc30.x86_64_xhci-hcd_xHCI_Host_Controller_0000:00:14.0
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/003/009 - Silicon_Labs_Corsair_Link_TM_USB_Dongle_R58K0626
    /dev/ttyUSB0 - Silicon_Labs_Corsair_Link_TM_USB_Dongle_R58K0626
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/003/004 - 05e3_USB2.0_Hub
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/003/006 - Generic_Flash_Card_Reader_Writer_058F63626479
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/sg11 -
    /dev/sdk - Generic-_MS_MS-PRO_058F63626479-0:2
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bsg/14:0:0:2 -
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/sg9 -
    /dev/sdi - Generic-_Compact_Flash_058F63626479-0:0
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bsg/14:0:0:0 -
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/sg12 -
    /dev/sdl - Generic-_xD-Picture_058F63626479-0:3
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bsg/14:0:0:3 -
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/sg10 -
    /dev/sdj - Generic-_SD_MMC_058F63626479-0:1
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bsg/14:0:0:1 -
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/003/007 - Crystalfontz_Crystalfontz_CFA635-USB_LCD_CF034972
    /dev/ttyUSB1 - Crystalfontz_Crystalfontz_CFA635-USB_LCD_CF034972
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/gpiochip0 -
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/003/002 - Corsair_CORSAIR_HARPOON_RGB_WIRELESS_Gaming_Mouse_ C5342F60F4432327
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/usb/hiddev1 -
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/hidraw2 -
    /dev/input/js0 - Corsair_CORSAIR_HARPOON_RGB_WIRELESS_Gaming_Mouse_ C5342F60F4432327
    /dev/input/mouse0 - Corsair_CORSAIR_HARPOON_RGB_WIRELESS_Gaming_Mouse_ C5342F60F4432327
    /dev/input/event2 - Corsair_CORSAIR_HARPOON_RGB_WIRELESS_Gaming_Mouse_ C5342F60F4432327
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/hidraw0 -
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/usb/hiddev0 -
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/hidraw1 -
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/004/001 - Linux_5.2.9-200.fc30.x86_64_xhci-hcd_xHCI_Host_Controller_0000:00:14.0
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/005/002 - VIA_Labs__Inc._USB2.0_Hub
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/005/001 - Linux_5.2.9-200.fc30.x86_64_xhci-hcd_xHCI_Host_Controller_0000:02:00.0
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/005/003 - VIA_Labs__Inc._USB2.0_Hub
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/006/001 - Linux_5.2.9-200.fc30.x86_64_xhci-hcd_xHCI_Host_Controller_0000:02:00.0
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/006/003 - VIA_Labs__Inc._USB3.0_Hub
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/006/005 - VIA_Labs_Inc._USB3.1_SATA_Bridge_0000000000000002
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/sg6 -
    /dev/sdf - ST8000DM004-2CX188_ZCT0NQ19
    /dev/sdf1 - ST8000DM004-2CX188_ZCT0NQ19
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bsg/11:0:0:0 -
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/006/002 - VIA_Labs__Inc._USB3.1_Hub
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/006/006 - VIA_Labs_Inc._USB3.1_SATA_Bridge_0000000000000003
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/sg7 -
    /dev/sdg - ST8000DM004-2CX188_WCT0DKZR
    /dev/sdg1 - ST8000DM004-2CX188_WCT0DKZR
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bsg/12:0:0:0 -
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/sg5 -
    /dev/sde - ST3000DM008-2DM166_Z505DG7V
    /dev/sde1 - ST3000DM008-2DM166_Z505DG7V
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bsg/10:0:0:0 -
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/006/004 - VIA_Labs_Inc._USB3.1_SATA_Bridge_0000000000000001
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/sg8 -
    /dev/sdh - ST8000DM004-2CX188_WCT0C965
    /dev/sdh1 - ST8000DM004-2CX188_WCT0C965
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bsg/13:0:0:0 -
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/006/007 - VIA_Labs_Inc._USB3.1_SATA_Bridge_0000000000000004
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/007/005 - Logitech_USB_Receiver
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/usb/hiddev2 -
    /dev/input/mouse2 - Logitech_USB_Receiver
    /dev/input/event6 - Logitech_USB_Receiver
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/hidraw5 -
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/hidraw4 -
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/007/001 - Linux_5.2.9-200.fc30.x86_64_xhci-hcd_xHCI_Host_Controller_0000:81:00.0
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/007/004 - Broadcom_Corp_BCM20702A0_001986000029
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/007/002 - Logitech_Logitech_USB_Headset
    /dev/snd/controlC0 - Logitech_Logitech_USB_Headset
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/snd/pcmC0D0c -
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/snd/pcmC0D0p -
    /dev/input/event3 - Logitech_Logitech_USB_Headset
    ./fndusb: line 9: continue: only meaningful in a `for', `while', or `until' loop
    /dev/hidraw3 -
    ./fndusb: line 7: continue: only meaningful in a `for', `while', or `until' loop
    /dev/bus/usb/008/001 - Linux_5.2.9-200.fc30.x86_64_xhci-hcd_xHCI_Host_Controller_0000:81:00.0
    [stevef@pita-24 UsbStuff]$

  2. #2
    Join Date
    Feb 2005
    Location
    London, UK
    Posts
    1,127
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Usb Script that works in F29 but not F30

    For/While loops don't use brackets so remove the "(" and ")", that's taking the continue out of the for loop.

  3. #3
    Join Date
    Nov 2010
    Location
    los an
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Usb Script that works in F29 but not F30

    thanks, Fixed

Similar Threads

  1. Replies: 1
    Last Post: 13th February 2014, 03:28 PM
  2. call remote shell script within an expect script
    By PhillyFloyd in forum Programming & Packaging
    Replies: 2
    Last Post: 16th October 2007, 10:29 PM
  3. Ndis install script. Hope it helps you guys (and works for you)
    By Vector in forum Servers & Networking
    Replies: 1
    Last Post: 14th October 2007, 07:26 AM
  4. Replies: 8
    Last Post: 1st September 2006, 10:08 AM
  5. Logrotate script only works when forced
    By gvarney in forum Using Fedora
    Replies: 0
    Last Post: 1st August 2005, 05:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •