Programming :: Shell Script To Find Usb Device Name?
May 19, 2011
I have a usb to serial converter which i plug in to Ubuntu Natty.I see that on every reboot this seems to come up as a different device name, say ttyUSB0, ttyUSB3 etc.I want to write a simple shell script to get the name of the device in a shellscript.
View 1 Replies
ADVERTISEMENT
Dec 27, 2010
From one day to the other my system stopped booting properly. Since I (finally) fixed it, I wanted to share my solution. It runs on a fakeraid pair of SSD's of 60 GB each (actually a single Revodrive device, but it shows up as two devices). When Ubuntu 10.10 boots, I'm dropped to a shell.During boot, when I removed "silent splash" from the kernel's command line, I got these messages:
Code:
[ 4.960240] scsi 6:0:0:0: Direct-Access ATA OCZ-REVODRIVE 1.20 PQ: 0 ANSI: 5
[ 4.960425] sd 6:0:0:0: [sdg] 117231408 512-byte logical blocks: (60.0 GB/55.8 GiB)
[cod]....
I doubt that this is what was needed (as I had that already when it didn't work, but I might be required in addition to installing dmraid)
# update-initramfs -a
After installing this, the problem was solved!! This is strange since I don't recall uninstalling this package or changing anything important, for that matter (perhaps did apt-get upgrade, but that's about it!). [URL]
View 2 Replies
View Related
Mar 30, 2011
I'm working on a script to table the outputs of various commands that depend on each other. The commands are these:
Code:
[root@kybsdc2 ~]# raw -q /dev/raw/raw1
[root@kybsdc2 ~]# sginfo -a /dev/dm-5 | grep Serial
[root@kybsdc2 ~]# multipath -ll
which give these outputs:
Code:
#/dev/raw/raw1:bound to major 253, minor 5
#Serial Number 'P3e8hZWrsSeX'
#netapp (360a9800050336538685a577273536558) dm-5 NETAPP,LUN
[size=1.0G][features=1 queue_if_no_path][hwhandler=0][rw]
[code]....
Also the RAW13 device has completely wrong output due to 1 occurring more times throughout the sequence causing more information to be displayed then needed. The last point is if I could somehow remove the '' in the serial number outputs and the = sign from the device sizes. I guess I will have to either put a whole lot of logical IF or CASE statements in but somehow I need to streamline and make this code dynamic!
View 8 Replies
View Related
Mar 10, 2009
What is best way to replace the 1 and the 3 below with a 0 using a shell script? It is in a text file with lots of lines and similar lines:
lots of text
...
useHeloBlacklist:=1
DoIPinHelo:=3
...
lots of text
View 5 Replies
View Related
Jul 3, 2009
I am trying to find / write a shell script that will go through a file organized like this (but with thousands of lines)...
93,5.00,"contig00002",169,83,"jgi|Brafl1|100379|fgenesh2_pg.scaffold_359000019"
579,1.00,"contig00003",3,380,"jgi|Brafl1|114745|estExt_fgenesh2_pm.C_1200006"
450,5.00,"contig00007",2,352,"jgi|Brafl1|274326|estExt_GenewiseH_1.C_8420008"
...and check the region of each line between the second and third pipes (the 6-digit numbers) against the values in the first column of a separate text file in CSV format like this...
274326,"Wnt family of developmental regulators"
114745,"FOG: Hormone receptors"
100379,"Transcription factor tinman/NKX2-3, contains HOX domain"
...and when they match, replace the value to the right of the third pipe (e.g., fgenesh2_pg.sca...) with the value in the second column in the CSV file associated with that number.
View 4 Replies
View Related
Feb 12, 2010
Hi I am trying to add the device by using followig code strip and it says that eth1 is not defind in the code.
strncpy(ifr.ifr_name,eth1,IFNAMSIZ);
if (ioctl(sd, SIOCGIFINDEX, &ifr) == -1) {
return 0;
}
How do I write down the DEVICE name in the ifr.ifr_name structure ?
View 2 Replies
View Related
Feb 1, 2010
I'm trying to get sound to work on an embedded board. The boot says ALSA is present and sound chip is present. So I try to open the device with:
The hardware manufacturer assures me the device is hw:0,0 so I set device to:
This gives me:
So I'm presuming the advice that I use hw:0,0 must be wrong? So I need to find a way of working out what the device id is. I've tried default, no effect, then tried the command asoundconf list, which returns an error. I'm using a min linux build on an embedded system (busybox) so is there a way to find my sound device.
View 2 Replies
View Related
Apr 20, 2010
can we find logarithm to base 10 instead of base 2 on shell script??i can do it with bc..like 'l(1000)/l(10)' | bc -l
View 1 Replies
View Related
May 15, 2011
Recently, I created a device sc0 through device mapper. The divice could be found in /dev/mapper/sc0. My problem is that the device doesn't exist in /dev/partitions which will block my following test.BTW, I found dm-0 in /dev/partitions. Is it the same as /dev/mapper/sc0? But the device /dev/dm-0 doesn't exist!
View 2 Replies
View Related
Aug 23, 2011
I've bought an X10 Home Automation USB interface: the CM15.
This is the information lsusb gives:
skerit@KIP-DU-SKER:~$ lsusb Bus 008 Device 002: ID 0bc7:0001 X10 Wireless Technology, Inc. ActiveHome (ACPI-compliant)
But this tells me nothing about where the device file is! How can I find that, or create one myself?
View 1 Replies
View Related
Jun 5, 2011
I am trying to create a shell script similar to ls, but which only lists directories. I have the first half working (no argument version), but trying to make it accept an argument, I am failing. My logic is sound I think, but I'm missing something on the syntax.
Code:
if [ $# -eq 0 ] ; then
d=`pwd`
for i in * ; do
if test -d $d/$i ; then
echo "$i:"
code....
View 10 Replies
View Related
Jun 25, 2010
Is there some type of functional way to read things in the Python shell interpreter similar to less or more in the bash (and other) command line shells?
Example:
Code:
>>> import subprocess
>>> help(subprocess)
...
[pages of stuff to read]
...
I'm hoping so as I hate scrolling and love how less works with simple keystrokes for page-up/page-down/searching etc.
View 4 Replies
View Related
Mar 17, 2011
I just compiled my first own kernel (I'm using Arch Linux), following the tutorial on the german site. Now I tried to boot it, I ended up failing with this message: Code: Waiting 10 seconds for device /dev/sda1 ... Root device '/dev/sda1' doesn't exist, Attempting to create it. ERROR: Unable to determine major/minor number of root device '/dev/sda1' Here is the important part of my menu.lst:
[Code]....
I simply copy&pasted the Arch-entry, i.e. I also had the disk by uuid there. The failure message was the same, just the root device name was the different name Also, at first I did not have the initrd line in my menu.lst (as written in my tutorial that I may not need it). In this case I had this error message:
[Code]....
View 10 Replies
View Related
May 18, 2011
shell scripting in Fedora14I want a script"Find in curent folder for files, and it copy first file he find with name gived by user, if name already exist then echo error message and finish"command usage " bash scriptname copyASname"
smthing like Code: #!/bin/bash
for files in /home/user/*
do
[code]....
View 1 Replies
View Related
Dec 15, 2009
I've created a simple script based menu. This menu will be accessed by only a certain users via ssh.When user logs in, the menu will automatically run. (configured at user's .bash_profile).How do I force the session to close when user hits Ctrl-C or Ctrl-Break ?In a nutshell, I don't want user to have access to shell.
View 11 Replies
View Related
Nov 29, 2010
I was upgrading online through my android phone's easytether app. My phone rang, and I was bounced offline. When I came back the upgrade did not resume, and when I tried to start over, dpkg and whatever was busy so I closed all my windows and tried to reboot. This is where I ended up: Here is a screenshot:
View 3 Replies
View Related
Jan 21, 2011
I recently started shell programming and my task now is to do a menu display.Currently i am stuck whereby user will input both title and author and it will delete it.
Do i have to use sed command?
View 4 Replies
View Related
May 30, 2010
I did searched you tube but my results were not great.I have 2 books on KernelProgramming.I feel I need if some where I can get a video tutorial which can help me to understand how to develop a Linux Device driver that will be great.I had a look at Greg Kroah Hartmans video lecture of developing patches on ......I have been reading books and a lot of stuff.So I wish if I could get a video lecture that would be better
View 1 Replies
View Related
May 17, 2010
Is it possible to assist in the programming Shell Scripts
Job:
To send a message to the email,All orders written in Terminal or ssh
example : ls , pwd , cat , and other
View 1 Replies
View Related
Mar 28, 2010
I have downloaded Fedora 12. How do I find out what the default shell is been used? I wish to determine a user's default shell.
View 3 Replies
View Related
Dec 6, 2010
I have two shell scripts:
sh1.sh
echo "First script"
echo "Now calling second one"
sh2.sh
sh2.sh
echo "Second script"
In this shell script, I want to print out which shell script called this. In this case, sh1.sh called sh2.sh. So, I want to print out "sh1.sh".How to achieve?
View 1 Replies
View Related
Mar 20, 2010
I'm running Intrepid and so far have failed to come up with anything other than detailed instructions on how to compile/install Gnome-Shell. Has anyone come up with a binary of gnome shell? It seems I once saw a link to a PPA...or maybe I'm just hallucinating
View 3 Replies
View Related
Nov 3, 2010
the below tag is in the xml file. Now i want to find and extract the value of application name test1 and test2 one by one in the unix shell script. how to do this
<application name="test1">
</application>
<application name="test2">
[code]...
View 2 Replies
View Related
Apr 17, 2011
I was trying to find a shell script that will encode video to a an iso that I can burn for a dvd. It seems I have lost a few of my dvds and I backed them up into mkv and I need to convert it to pal so it will work until I find them. My search was leading to other formats, but I was wanting to use pal because it is smaller. My search lead me here, but this shell script is not in pal.I need a solution that would work with slackware.
View 2 Replies
View Related
Jul 20, 2010
am trying to write a shell script to find the size of a particular log file and if the log size grows, script should mail the changes to the administrator or a any user so script should monitor the log file continuously in a time interval, how can i do that?
I tried with these codes to find the file size but it throws me error says command not found
$s=$( stat -c %s mylogfile.log)
echo $s
View 10 Replies
View Related
Feb 11, 2010
I've been trying to configure my tablet's screen rotation. I can get the screen to rotate, but not the wacom rotation.
Code:
$ xsetwacom set "STYLUS" Rotate ccw
Cannot find device 'STYLUS'.
[code]...
View 2 Replies
View Related
May 23, 2011
How can I find which /dev/? device to mount my USB hard drive on redhat 3 taroon, I've been googling a lot and checked log files and still no clue. I'm trying my last chance with you experts, # /sbin/fdisk -lgives nothing about the USB drive
# lsusb -vv
Bus 004 Device 005: ID 059f:0951 LaCie, Ltd
Device Descriptor:
[code]....
View 4 Replies
View Related
Jul 11, 2011
I have a microphone that I connected via USB. When I do dmesg it shows [37830.040274] usb 5-1: new full speed USB device using uhci_hcd and address 4 How do I find out what /dev/??? identifier has been associated with the device? I want to record something using XVidCap and need to set the microphone for it to work.
View 5 Replies
View Related
Jul 28, 2011
What command do I need to use to find the device name of drives , in particular an inserted USB drive that is not mounted yet ?Everywhere I search tell me to do this:
Code:
tail -f /var/log/messages
But that file doesn't exist
View 3 Replies
View Related
Sep 1, 2010
what would be the simplest way to find out device IP address? I don't know its factory set address, so my plan is to connect laptop directly to it with ethernet. it should respond to ping.
View 7 Replies
View Related