Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Combat Pretzel
Jun 23, 2004

No, seriously... what kurds?!
Using the command line myself, too. As far as NC clones go, I constantly try to get myself using them, but the file manager overlay bugs me a whole lot.

Adbot
ADBOT LOVES YOU

Combat Pretzel
Jun 23, 2004

No, seriously... what kurds?!
Ok, here's a different one. Am I understanding this right:

If I set LD_LIBRARY_PATH, the runtime linker goes looking for things there first, before working the default paths? If so, were I to customize the base system without touching anything outside say /usr/local, e.g. a newer version of Freetype, I'd compile and install them into /usr/local and set LD_LIBRARY_PATH accordingly (for instance in .xprofile).

teapot
Dec 27, 2003

by Fistgrrl

Toiletbrush posted:

Ok, here's a different one. Am I understanding this right:

If I set LD_LIBRARY_PATH, the runtime linker goes looking for things there first, before working the default paths? If so, were I to customize the base system without touching anything outside say /usr/local, e.g. a newer version of Freetype, I'd compile and install them into /usr/local and set LD_LIBRARY_PATH accordingly
Yes, libraries in those directories will be before everything else in the search order, except when executable is setuid. As long as libraries remain compatible with both executable they are linked to, and with executables/data installed in the system, they should work.

quote:

(for instance in .xprofile).
What package uses .xprofile for that? It's usually .xinitrc, .xsesion or .gnomerc

Combat Pretzel
Jun 23, 2004

No, seriously... what kurds?!
I'm running Gnome under Solaris, as supplied with the Solaris Express distro. When I've looked for an insertion point, first reference was .xprofile. Tried it and worked.

I want the changes to be limited to my regular account only and keep root virgin, otherwise I'd put it in /etc/profile.

The changes Sun introduces for the packages that go with SXCE change a lot of things anyway, since Gnome has to work with cde-login, and CDE with GDM, and everything has to work via SMF. They've tampered with the whole X init process as far as I know. Vanilla Linux guides of changing various things related to X, GDM and such don't always work.

ErikTheRed
Mar 12, 2007

My name is Deckard Cain and I've come on out to greet ya, so sit your ass and listen or I'm gonna have to beat ya.
So this past week I made the obligatory step up from Ubuntu to Arch Linux. I'm liking it a whole lot so far, as it seems to feel a bit more zippy than Ubuntu in general. I do like having the rolling update system in Arch, I hated in Ubuntu where I either had to wait for the next release or use unofficial repos to install the latest stuff. Pacman is also very easy to use once you figure out all the commands. kdemod is also a pretty awesome KDE setup.

Not much a question for the Linux Questions thread, but I just wanted to say that Arch is awesome.

teapot
Dec 27, 2003

by Fistgrrl

Toiletbrush posted:

I'm running Gnome under Solaris, as supplied with the Solaris Express distro. When I've looked for an insertion point, first reference was .xprofile. Tried it and worked.

I want the changes to be limited to my regular account only and keep root virgin, otherwise I'd put it in /etc/profile.

The changes Sun introduces for the packages that go with SXCE change a lot of things anyway, since Gnome has to work with cde-login, and CDE with GDM, and everything has to work via SMF. They've tampered with the whole X init process as far as I know. Vanilla Linux guides of changing various things related to X, GDM and such don't always work.

Oh, the remnants of CDE... That explains why I haven't seen it recently.

rugbert
Mar 26, 2003
yea, fuck you
Is there a set of codecs I an download like defilerpak? I have VLC but some video files wont play, the actual video wont play but Ill get sound so Im hoping all I need is some new codec

Also - Whats a good iPod program? I was using ephPod with Wine but it was buggy and didnt save the playlists I made.

The Remote Viewer
Jul 9, 2001
According to the WINE appdb, iTunes 6.0 works reasonably well now. It's a start, at least.

covener
Jan 10, 2004

You know, for kids!

rugbert posted:

Also - Whats a good iPod program? I was using ephPod with Wine but it was buggy and didnt save the playlists I made.


gnupod is nice and simple

indigoe
Jul 29, 2003

gonna steal the show, you know it ain't no crime
I'm attempting to run several virtualised machines using xen. I have them up and running fine, however, I would like all of them to have access to a shared partition, let's call it /dev/LogVol00/data. Now this is mounted by the host, and when I start up a virtual pc I get the message the device is mounted in the privileged domain and so cannot be mounted as guest. Is there any way around this? I know the answer may be as simple as 'not possible' in which case I have a backup plan: map the directory on that partition as a network share on each virtual pc. Or am I crazy for thinking that would be a good idea?

Threep
Apr 1, 2006

It's kind of a long story.

covener posted:

gnupod is nice and simple
And very buggy/lacking if you have a video iPod. For nothing but music it's great though.

other people
Jun 27, 2004
Associate Christ
Does anyone have any tips for getting Steam to work under wine?

I have a fresh install of gentoo, kernel 2.6.21, and wine-0.9.45. I followed the guide at winehq for installing Steam and it all went off without a hitch.

Steam starts and seems to run, but it will always lock up, usually while steam is still logging in but sometimes I can get to the game list and start it downloading stuff. It never lasts more than thirty seconds though.

RoundsToZero
Dec 3, 2004

An open door is an invitation

indigoe posted:

I'm attempting to run several virtualised machines using xen. I have them up and running fine, however, I would like all of them to have access to a shared partition, let's call it /dev/LogVol00/data. Now this is mounted by the host, and when I start up a virtual pc I get the message the device is mounted in the privileged domain and so cannot be mounted as guest. Is there any way around this? I know the answer may be as simple as 'not possible' in which case I have a backup plan: map the directory on that partition as a network share on each virtual pc. Or am I crazy for thinking that would be a good idea?

You generally don't want multiple filesystem drivers hammering the same block device at the same time, which is why it won't let you mount the filesystem twice. The network method should be fine as long performance is good enough. VMware has a "shared folders" feature that doesn't require the network, but in my experience it's actually slower than just using the network.

Or use GFS instead of whatever you're currently using on your block device.

deong
Jun 13, 2001

I'll see you in heck!
Does anyone use web filtering; similar to say net nanny?
I have been looking at DansGuardian and it seems to be able to do what I'm wanting.
Basically looking for a web filter that will be installed on a laptop with multiple users. I'd like to be able to set up a web proxy for a 12yro and then have a non filtered profile also. So if I am understanding DG correctly, I'd just set one profile to use a proxy, and the other will not.
Any other good known options?

Thanks

CrazyLittle
Sep 11, 2001





Clapping Larry

deong posted:

I'd like to be able to set up a web proxy for a 12yro and then have a non filtered profile also. So if I am understanding DG correctly, I'd just set one profile to use a proxy, and the other will not.

By the time the 12yr old is 12.5yr old, both profiles won't be using the proxy :eng101:

Anything that's within reach of the person using the computer can be turned off. Dansguardian does a decent job of filtering on a preset whitelist, but the wordfiltering functions often get a lot of false positives (like "breast cancer"). I'd say it's the best -free- solution out there, but you should still set DG to be a NAT'd proxied filter on your firewall instead of on the computer itself.

deong
Jun 13, 2001

I'll see you in heck!

CrazyLittle posted:

By the time the 12yr old is 12.5yr old, both profiles won't be using the proxy :eng101:

Anything that's within reach of the person using the computer can be turned off. Dansguardian does a decent job of filtering on a preset whitelist, but the wordfiltering functions often get a lot of false positives (like "breast cancer"). I'd say it's the best -free- solution out there, but you should still set DG to be a NAT'd proxied filter on your firewall instead of on the computer itself.

Oh yea.. well understood. I don't think the 12yr is going to be changing the settings intentionally, so its more of a preventive measure against accidental and more so for some peace of mind for her mother heh. Thanks for the info on word filtering. I was thinking that sounded like a great idea, but now you mention that I see where it'll be a problem. I found that the Christian Edition of Ubuntu has a nice setup script for the whole DG/TinyProxy/web gui to include new sites/words and such.. so think I'll that route first.

Again, thanks.

DirtyDiaperMask
Aug 11, 2003

by Ozmaugh
I rum MythTV on a computer with tv-out only, no monitor. Everything is well and dandy, except that I run Azureus on it (can't use torrentflux or rtorrent since they don't have auto speed and torrentflux is a dick sometimes). So the computer starts, and auto-logs in and runs a script from gnome-session which kills the screensaver, loads Azureus, then MythTV. The problem is that Azureus shows up on top of MythTV no matter what I do.

I also FreeNX into the computer often, and everytime I do, it brings up a new instance of MythTV on DISPLAY=":0.0" and gets annoying. I've tried to have MythTV run on Fluxbox so that when I open up a FreeNX session I can use gnome-session without the MythTV startup script, but Fluxbox doesn't have a session manager from what I know.

Any easy and practical suggestions? Also, I can't just use MythTV without a WM, since I need it to fire up Mplayer.

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice
I'm running Kubuntu Fiesty with a fresh install. I basically want to access my Mysql database via SSH from school so that my group can work on it during class and I can do the real work/fix their mistakes at home.

I have both the openSSH server installed and the MySQL server/client installed. I configured my iptables to have 22 open for SSH. So far, I can go through shell to ssh into my own computer with my ip address (ie poemdexter@123.123.123.123 or whatever the ip is at the moment). However, when I am at school, I cannot even ping my own address. The tech support guy at the school says that my ports must not be open because it's not a firewall issue at the school.

Should I call bullshit on him, or am I missing some step to ssh into my computer to be able to get shell access to work on my computer?

Also, I have the official MySQL query browser installed. Could I connect to my database at home through that and skip all of this SSH nonsense?

teapot
Dec 27, 2003

by Fistgrrl

DirtyDiaperMask posted:

I rum MythTV on a computer with tv-out only, no monitor. Everything is well and dandy, except that I run Azureus on it (can't use torrentflux or rtorrent since they don't have auto speed and torrentflux is a dick sometimes). So the computer starts, and auto-logs in and runs a script from gnome-session which kills the screensaver, loads Azureus, then MythTV. The problem is that Azureus shows up on top of MythTV no matter what I do.

I also FreeNX into the computer often, and everytime I do, it brings up a new instance of MythTV on DISPLAY=":0.0" and gets annoying. I've tried to have MythTV run on Fluxbox so that when I open up a FreeNX session I can use gnome-session without the MythTV startup script, but Fluxbox doesn't have a session manager from what I know.

Any easy and practical suggestions? Also, I can't just use MythTV without a WM, since I need it to fire up Mplayer.
The simpliest solution is to create a separate user for remote sessions with Azureus.

Fluxbox is a window manager, it runs within a session, so it may run under some session manager, but usually just runs from $HOME/.xsession script that is usually used as a minimal X session. So yur other solution is to write .xsession script that checks $DISPLAY and if it is ":0", runs Fluxbox in background, then MythTV, otherwise runs gnome-session. gdm/kdm/xdm/... should be configured to run minimal session

indigoe
Jul 29, 2003

gonna steal the show, you know it ain't no crime

poemdexter posted:

I'm running Kubuntu Fiesty with a fresh install. I basically want to access my Mysql database via SSH from school so that my group can work on it during class and I can do the real work/fix their mistakes at home.

I have both the openSSH server installed and the MySQL server/client installed. I configured my iptables to have 22 open for SSH. So far, I can go through shell to ssh into my own computer with my ip address (ie poemdexter@123.123.123.123 or whatever the ip is at the moment). However, when I am at school, I cannot even ping my own address. The tech support guy at the school says that my ports must not be open because it's not a firewall issue at the school.

Should I call bullshit on him, or am I missing some step to ssh into my computer to be able to get shell access to work on my computer?

Also, I have the official MySQL query browser installed. Could I connect to my database at home through that and skip all of this SSH nonsense?

If you have a router between the server and the internet, the port needs to be forwarded.

Mysql needs to have a user created (I recommend limited privilieges for security reasons) that is able to connect from outside. This is defined by the host field in mysql.user table. % is the mask for all hosts (by default all users must connect from localhost) if you don't know the school's ip address.


RoundsToZero posted:

You generally don't want multiple filesystem drivers hammering the same block device at the same time, which is why it won't let you mount the filesystem twice. The network method should be fine as long performance is good enough. VMware has a "shared folders" feature that doesn't require the network, but in my experience it's actually slower than just using the network.

Thanks, that explains it. I'm not too worried about the load on the server and the purpose of the whole thing is to have various test environments with some shared files. Now I'm trying to get NFS to work but it keeps giving me access denied when I try to mount. I also get these errors in /var/log/messages (on the server) when I attempt to mount the share with the client

code:
nfsd[6923]: nfssvc: writing fds to kernel failed: errno 0 (Success)

indigoe fucked around with this message at 05:14 on Sep 19, 2007

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice

indigoe posted:

If you have a router between the server and the internet, the port needs to be forwarded.

Mysql needs to have a user created (I recommend limited privilieges for security reasons) that is able to connect from outside. This is defined by the host field in mysql.user table. % is the mask for all hosts (by default all users must connect from localhost) if you don't know the school's ip address.


No router between the server and internet. I'm guessing you're saying I can use the query browser to log into my server as long as I have a user created that can connect from my school.

teapot
Dec 27, 2003

by Fistgrrl

indigoe posted:

If you have a router between the server and the internet, the port needs to be forwarded.
Correct, but only for NAT routers. If his address is 192.168.x.x or 10.x.x.x, or 172.16.x.x, then it is not supposed to be reachable from outside, and has to be forwarded from the router (and he will have to connect to the router's public address).

quote:

Mysql needs to have a user created (I recommend limited privilieges for security reasons) that is able to connect from outside. This is defined by the host field in mysql.user table. % is the mask for all hosts (by default all users must connect from localhost) if you don't know the school's ip address.

DO NOT TRY TO ACCESS MYSQL OVER THE INTERNET WITHOUT TUNNELING. The whole point of using ssh is to forward MySQL connections is that it looks like connection over the local network or, in this case, from localhost. He will still have to enable TCP in MySQL, and he will need a MySQL user with password defined for authentication, but he will only need connections from localhost.

Kobayashi
Aug 13, 2004

by Nyc_Tattoo
How is /mnt supposed to be used? I have an ancient Dell that I am using as my home fileserver. I put an extra 120 Gb hard drive in there and mounted it to /mnt/store. It has become the catch-all for everything I want to keep: svn repositories, htdocs, MP3 backup, and other assorted crap. I read something somewhere the other day that suggested I shouldn't be using /mnt like this.

A) What should I use /mnt for?

B) What is the best way to store a whole bunch of stuff on a separate HD? I know how to mount directories, but I'm not sure which one I should be using.

Scaevolus
Apr 16, 2007

Kobayashi posted:

A) What should I use /mnt for?

/mnt/store sounds like a perfectly fine place for that. It's the same question as how your home folder should be organized-- it's all personal preference. If the files are mostly an extension of what might be in your home folder, I would make a symbolic link so it appears in your home folder (/home/kobayashi/svn -> /mnt/store/svn, etc.)

teapot
Dec 27, 2003

by Fistgrrl

Kobayashi posted:

How is /mnt supposed to be used? I have an ancient Dell that I am using as my home fileserver. I put an extra 120 Gb hard drive in there and mounted it to /mnt/store. It has become the catch-all for everything I want to keep: svn repositories, htdocs, MP3 backup, and other assorted crap. I read something somewhere the other day that suggested I shouldn't be using /mnt like this.

A) What should I use /mnt for?

B) What is the best way to store a whole bunch of stuff on a separate HD? I know how to mount directories, but I'm not sure which one I should be using.

/mnt is traditionally used for various disks mounted temporarily, however after the start of widespread use of automounters it became more common to have removable media in /media (/meda/USB DISK , /media/sda1 ). Permanently mounted drives with some particular purpose (home directories, optional full packages, variable data, etc.) are mounted under their corresponding directories (/home , /opt , /var ) without any symlinks, however I don't think, there is any universally accepted standard for mixed-use drives. I often mount such drives as /1 , /2 , etc., and it probably will be just as good to mount them as /mnt/1 , /mnt/2 , etc. Shared Windows drives are commonly mounted as /windows/c , /windows/d , etc.

I don't recommend using device names such as /mnt/sda1 under /mnt because as the history had shown, device names may change as the progress in kernel development moves hardware support between drivers, so something that was /dev/hda1 a year ago now looks like /dev/sda1 .

What is definitely not a good idea is to monopolize /mnt by mounting the filesystem directly under it instead of creating a subdirectory that will somehow identify the device, so your naming scheme seems to be just fine. /1 and /mnt/1 directories shouldn't be harcoded into configuration files, and if the drive is general-purpose, it should be possible to put system directories on it, so it's a good idea to symlink drive's subdirectories to some place in the existing filesystem tree where they make sense. As long as drive is mounted early enough in the boot-up process so whatever piece of software that uses it can't start before the drive is mounted, it should be safe, and it will allow reshuffling of directories between drives in the future.

Remote filesystems such as NFS, SMB and all kinds of FUSE-based stuff, can be mounted wherever they are necessary, reflecting flexibility of their configuration.

teapot fucked around with this message at 23:32 on Sep 19, 2007

Harokey
Jun 12, 2003

Memory is RAM! Oh dear!
I want to find the hardware address of a machine.

So far I have this:

/sbin/ifconfig eth0 | grep HWaddr

I thought I would pipe that into "cut" but it looks like cut only wants to read from a file, and won't go from stdin. Any other ideas?

teapot
Dec 27, 2003

by Fistgrrl

Harokey posted:

I want to find the hardware address of a machine.

So far I have this:

/sbin/ifconfig eth0 | grep HWaddr

I thought I would pipe that into "cut" but it looks like cut only wants to read from a file, and won't go from stdin. Any other ideas?

Huh? cut by default reads stdin, here is how it works with ifconfig (had to use sed to collapse the spaces):

code:
/sbin/ifconfig eth0|head -n 1|sed 's/ \+/ /g'| cut -d' ' -f5
or, better, just with sed:

code:
/sbin/ifconfig eth0|head -n 1|sed -e 's/^.*HWaddr //g' -e 's/ *$//'

teapot fucked around with this message at 00:44 on Sep 20, 2007

Alowishus
Jan 8, 2002

My name is Mud

Harokey posted:

I thought I would pipe that into "cut" but it looks like cut only wants to read from a file, and won't go from stdin. Any other ideas?
cut should definitely work from stdin. This works for me:
code:
/sbin/ifconfig eth0 | grep HWaddr | cut -f11 -d' '
Not sure if using space as delimiter is ideal... something seems wrong about the MAC being field 11... perhaps there's a better tool or approach, but this will get you started.

Edit: ^^^ bang teapot is right on

Scaevolus
Apr 16, 2007

Harokey posted:

I want to find the hardware address of a machine.

So far I have this:

/sbin/ifconfig eth0 | grep HWaddr

I thought I would pipe that into "cut" but it looks like cut only wants to read from a file, and won't go from stdin. Any other ideas?

/sbin/ifconfig eth0 | grep HWaddr | cut -c 39-

works, but I don't think ifconfig gives constant output.

/sbin/ifconfig eth0 | grep HWaddr | awk '{print $5}'

might work slightly better

e;f,b

improved space squeezing:
code:
/sbin/ifconfig eth0 | head -n 1 | tr -s ' '| cut -d ' ' -f 5

Scaevolus fucked around with this message at 00:48 on Sep 20, 2007

Harokey
Jun 12, 2003

Memory is RAM! Oh dear!

teapot posted:

code:
/sbin/ifconfig eth0|head -n 1|sed -e 's/^.*HWaddr //g' -e 's/ *$//'

Thanks, I guess I was screwing up the syntax somewhere else then.

I used this one, Thanks everyone!

Edit:
Out of curiosity, is there a way to do this all in perl, other than by just calling that command?(which I'm doing right now)

Scaevolus
Apr 16, 2007

Harokey posted:

Edit:
Out of curiosity, is there a way to do this all in perl, other than by just calling that command?(which I'm doing right now)

You can also just grab the contents of /sys/class/net/eth0/address :ssh:

Obsolete
Jun 1, 2000

I have a quick grep question.

I have a txt file that has lines that look like:

IM,009-0001,D,0,@xxxxxxx_0907266001;IMAGES\00\00;009-0001.TIF;2
IM,009-0002, ,0,@xxxxxxx_0907266001;IMAGES\00\00;009-0002.TIF;2
IM,009-0003, ,0,@xxxxxxx_0907266001;IMAGES\00\00;009-0003.TIF;2

Basically, all I want to do is strip the zeroes out of the first part (the part immediately after the IM),and change the hyphen to a period.

So, I want to go from:
code:
IM,009-0001,D,0,@xxxxxxx_0907266001;IMAGES\00\00;009-0001.TIF;2
To:
code:
IM,9.1,D,0,@xxxxxxx_0907266001;IMAGES\00\00;009-0001.TIF;2

GringoGrande
Jul 27, 2001
Nah...

Obsolete posted:

I have a quick grep question.
grep probably isn't what you are looking for, you should try sed instead.
code:
sed -r -e 's/0*([0-9])-0*([0-9])/\1\.\2/' <file>

GringoGrande fucked around with this message at 18:53 on Sep 20, 2007

Prince John
Jun 20, 2006

Oh, poppycock! Female bandits?

ErikTheRed posted:

So this past week I made the obligatory step up from Ubuntu to Arch Linux. I'm liking it a whole lot so far, as it seems to feel a bit more zippy than Ubuntu in general. <snip>
Not much a question for the Linux Questions thread, but I just wanted to say that Arch is awesome.

Just wanted to say that you inspired me to make a switch, as everything seemed to be slowing down in Ubuntu as time went on.

I've been really impressed with Arch's speed and surprised by how much faster it is. I'm at a command line in about 10 seconds after leaving grub (as opposed to about 30 in Ubuntu) and can load Gnome in about half a second (about 10 seconds in Ubuntu) and things like opening my Home folder now happen instantly without the 5-10 second grinding of the HD that was beginning to annoy me in Ubuntu (same thumbnail settings etc).

I had a brief hairy moment when the madwifi package from the archives I manually downloaded was compiled for a later kernel than the install cd (the disadvantage of a rolling release!) but was able to compile and install from source as the kernel headers came with the base cd (wireless is my only connection).

Getting wpa_supplicant to work seemed a touch more complicated than necessary, but after some trial and error I got it working. The documentation wasn't in quite enough depth for my little Linux knowledge on occasion, but made it through with some googling. Spent 20 minutes trying to figure out why I was associating to the wireless point but couldn't ping anything - I'd never had to manually run dhcpcd before! ;)

All in all, a surprisingly fast and easy-to-use distro, given the complete lack of graphical admin tools. I feel like I'm learning a lot, but without being thrown in too deep.

Crush
Jan 18, 2004
jot bought me this account, I now have to suck him off.
I am almost done creating a script (for Mplayer/Mencdoder) to rip my DVDs for my HTPC and was looking for some help with the script I made.

What I need to know is if anyone knows how I would go about getting 128, 137, 130, and 131 from these lines (I'm assuming using either sed or cut?)

code:
audio stream: 0 format: ac3 (5.1) language: en aid: 128.
audio stream: 1 format: dts (5.1) language: en aid: 137.
audio stream: 2 format: ac3 (stereo) language: es aid: 130.
audio stream: 3 format: ac3 (stereo) language: fr aid: 131.
I looked at the man pages and tutorials on the internet trying to figure out exactly how I would do this, but I guess I am just too thick headed :(

Also, it doesn't have to grab the numbers from those lines all at once, it can do them one at a time.

Oh, and one more thing, these numbers (128, 137, 130, and 131) as well as things like ac3, dts, stereo, mono, en, es, and fr all change depending upon the DVD.

Thanks a bunch!

teapot
Dec 27, 2003

by Fistgrrl

Crush posted:

I am almost done creating a script (for Mplayer/Mencdoder) to rip my DVDs for my HTPC and was looking for some help with the script I made.

What I need to know is if anyone knows how I would go about getting 128, 137, 130, and 131 from these lines (I'm assuming using either sed or cut?)

code:
audio stream: 0 format: ac3 (5.1) language: en aid: 128.
audio stream: 1 format: dts (5.1) language: en aid: 137.
audio stream: 2 format: ac3 (stereo) language: es aid: 130.
audio stream: 3 format: ac3 (stereo) language: fr aid: 131.
I looked at the man pages and tutorials on the internet trying to figure out exactly how I would do this, but I guess I am just too thick headed :(

Also, it doesn't have to grab the numbers from those lines all at once, it can do them one at a time.

Oh, and one more thing, these numbers (128, 137, 130, and 131) as well as things like ac3, dts, stereo, mono, en, es, and fr all change depending upon the DVD.

Thanks a bunch!

If you really need a comma-separated list with a newline at the end:

code:
sed -e 's/^.* language: //' -e 's/^.*: //' -e 's/\. *$//' | tr '\012' , | sed 's/,$/\n/'

teapot
Dec 27, 2003

by Fistgrrl
I am afraid, this thread may degrade into an Unspellable Bee contest.

Crush
Jan 18, 2004
jot bought me this account, I now have to suck him off.

teapot posted:

If you really need a comma-separated list with a newline at the end:

code:
sed -e 's/^.* language: //' -e 's/^.*: //' -e 's/\. *$//' | tr '\012' , | sed 's/,$/\n/'

No no, I don't need a comma separated list. Sorry that was my fault for not clarifying. Really, I only need to know how to get the last three numbers on each line, sans the period at the end.

I'll try yours and see if I can tweak it to get what I need though. Thanks.

teapot
Dec 27, 2003

by Fistgrrl

Crush posted:

No no, I don't need a comma separated list. Sorry that was my fault for not clarifying. Really, I only need to know how to get the last three numbers on each line, sans the period at the end.

I'll try yours and see if I can tweak it to get what I need though. Thanks.
code:
sed -e 's/^.* language: //' -e 's/^.*: //' -e 's/\. *$//'

Adbot
ADBOT LOVES YOU

GringoGrande
Jul 27, 2001
Nah...

teapot posted:

code:
sed -e 's/^.* language: //' -e 's/^.*: //' -e 's/\. *$//'
Or he could use gawk:
code:
gawk -F'[ \.]' '{print $(NF-1)}'

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply