Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm working on a simple bash script that ultimately will read the name of a cd/dvd and output that as a header into a document, then read the file contents and output them formatted into the file. My first problem is that I don't know how to get the disk name outputted without Volname (Read Next). My second problem is that I'm using Cygwin for Bash and unfortunately don't have Volname available.
So, I was thinking possibly outputting some LS with a switch that might show the volume name and just GREP'ing it out, but I've had no luck finding any way to get a volume name outputted without Volname.
Any help getting a disk's name outputted without Volname, or even a complete script of how someone else would do this if you had the time, would be great!
Works great, but if I were you I'd take /dev/cdrom, this way you use the link to the proper device and de device name itself can change.
Just a detail though.
Unfortunately, Cygwin has no /Dev, so this method doesn't work with it, but I did try that out and the idea works well in an actual fully functional Bash environment. I don't know if there is any way to get a volume name through this barring switching completely over to Linux on that computer or somehow importing the Volname command over to it.
However, if you prefer to e operating in WinDOHs at this stage
you could give qemu a shot, and emulate a PC running a real Linux
under Windows. Or, of course, go the other way round and install
some Linux, run qemu and have winDOHs tucked away in a virtual
machine :}
As for cygwin itself; I wouldn't have a clue whether it has the
executable ready for install, or how trivial it would be to try
and port that piece of software.
"Beginning with Cygwin 1.3.4, raw devices are accessible by Cygwin processes using fixed POSIX device names. These fixed POSIX device names are generated using a direct conversion from the POSIX namespace to the internal NT namespace. E.g. the first harddisk is the NT internal device \device\harddisk0\partition0 or the first partition on the third harddisk is \device\harddisk2\partition1. The first floppy in the system is \device\floppy0, the first CD-ROM is \device\cdrom0 and the first tape drive is \device\tape0"
Of course I'd like to emphasise I'd rather see you use the versatile, robust, performant and generally way more efficient GNU/Linux over using the eternally blue-screeing, cut-n-perish, POS (Pitiful Operating System aka the MICROS~1 Game Platform)
Last edited by unSpawn; 06-10-2006 at 08:05 PM.
Reason: //--add-emphasis
I do the same thing at work. I installed Cygwin on our video encoder, and have a simple two or three line script that reads the DVD backup's directory and produces a PDF catalog of the videos I've backed up. ( Although each line has a lot of pipes, using sed and enscript, so the line count of the script isn't totally an honest measure.)
I don't read the volume name, but instead enter the name of the disk as an argument to the script. Since I occasionally don't get the disc label right anyway, what I label on the top of the DVD with a marker is what I use as an argument to the script, and is what the catalog shows.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.