08-04-2005
removing parts of a line with SED
hi,
i'm trying to erase all the characters after, and including, the first [ bracket.
Example: test1 test2 test3 [test4 test5] test test [a b c]
Output: test1 test2 test3
this is what I tried, but didn't work
sed "s/*[$[]//" file > testfilename
any suggestions?
thanks,
gammmaman
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
All,
I have a field in a comma seperated file with hundreds of lines and about 20 columns and I wish to remove all numbers after the decimal point in field 4 on each line and output the rest to another file or write it back to itself.
File is like this
20070126, 123.0, GBP, 1234.5678,... (9 Replies)
Discussion started by: kieranh
9 Replies
2. Shell Programming and Scripting
i need to use sed to remove an entire line containing a pattern stored in a variable say $var1
this var1 will be a URL and will therefore contain slashes
any help would be greatly appreciated (1 Reply)
Discussion started by: Fire_Storm
1 Replies
3. Shell Programming and Scripting
I am working with bash on HP-UX server at school.
As practice for scripting, I am trying to make a pretend server admin script that adds a user to the system, deletes a user from the system, and lists all users of the pretend system. I have accomplished this with a select loop. Adding users, and... (2 Replies)
Discussion started by: masterscout1977
2 Replies
4. UNIX for Dummies Questions & Answers
Hello Friends, How can I remove the last two values of this line using sed
John Carey:507-699-5368:29 Albert way, Edmonton, AL 25638:9/3/90:45900
The result should look like this:
John Carey:507-699-5368:29 Albert way, Edmonton, AL 25638 (3 Replies)
Discussion started by: humkhn
3 Replies
5. Shell Programming and Scripting
All:
Can somebody help me out with a sed command, which removes the the first occurance of ')' until the end of the line
If I have the following input
... (5 Replies)
Discussion started by: BeefStu
5 Replies
6. UNIX for Dummies Questions & Answers
hi all,
I am having trouble finding the right string for this - I dont know whether to use awk or sed..
If I have a file with alot of names and phone numbers like this
McGowan,Sean 978-934-4000
Kilcoyne,Kathleen 603-555-1212
Club603,The 617-505-1332
Boyle,William 301-444-1221
And... (11 Replies)
Discussion started by: alis
11 Replies
7. Shell Programming and Scripting
Hello.
The token is any printable characters between 2 " .
The token is unknown, but we know that it is between 2 "
Tok 1 : "1234x567"
Tok 2 : "A3b6+None"
Tok 3 : "A3b6!1234=@"
The ligne is :
Line 1 :
"9876xABCDE"Do you have any code fragments or data samples in your post
Line 2 : ... (3 Replies)
Discussion started by: jcdole
3 Replies
8. Shell Programming and Scripting
Hi Guys,
I have file A.txt
1
2
3
4
5
6
7
8
9
10
11
Want Output :-
1 2 3 (3 Replies)
Discussion started by: pareshkp
3 Replies
9. Shell Programming and Scripting
I have a long list of lines in a txt file which i'm only interested to extract the list of domains like the colored ones.
domain.com domain.com/page codes $.09
domain.org domain.org/page2/ codes $0.10
domain.net domain.net/page03 codes $0.05
domain.info ... (3 Replies)
Discussion started by: garfish
3 Replies
10. Answers to Frequently Asked Questions
hello,
I'm using sed command to extract the text between 2 special characters which are /* and */
I used following command to do this.
sed -n '/\/\*/,/\*\//p' file.txt
But if the file.txt contains a line something like this,
a=5; /* this is a comment */
the above command... (3 Replies)
Discussion started by: beginner_99
3 Replies
LEARN ABOUT DEBIAN
oss_imux
oss_imux(7) OSS Devices oss_imux(7)
NAME
oss_imux - Input Muplexer audio driver.
DESCRIPTION
IMUX is a virtual recording engine that permits up to 8 audio recording applications to run at the same time. Generally most soundcards
permit only a single recording application to record the input source (via mic, line or CD). With IMUX, you can use up to 8 recording
applications to record the same source in different sample rates, bits/sample and channels (mono/stereo). IMUX does all the rate and for-
mat conversion in software. The applications think that they are actually getting data from the physical device. For instance, if you want
to record the input from a CDROM in .wav format at 48Khz/8/Mono and at the same time you want to record the same stream in .mp3 format in
44.1Khz 16 bit stereo, with IMUX, you can start the wave recording application on the first IMUX device and start the MP3 encoder on the
second IMUX device and both applications will run simultaneously thinking that they are getting data from the physical soundcard.
CONFIGURATION
To add the IMUX driver you first need to ensure that there is a physical soundcard present and then you can run ossdetect -i to add it. You
may want to select a master device by setting imux_masterdev, but the autodetection should provide a good default. After OSS restart, imux
should be available.
USAGE
Connect an input source to the soundcard's line-in jack. Using the Mixer app like ossmix (or any OSS compliant mixer) set the recording
source to Line-In (eg ossmix line.rec ON) Now you can start recording the input in multiple formats and at different sample rates. The sim-
plest example is:
ossrecord -s48000 -b16 -c2 -d/dev/oss/oss_imux0/pcmin0 test1.wav &
ossrecord -s8000 -b8 -d/dev/oss/oss_imux0/pcmin0 test2.wav &
After a few minutes of recording you can stop them by placing the command in forground mode (type fg %1 or fg %2) and press ^c to stop.
You now have two wav format files. test1.wav is a 48KHz 16bit stereo file and test2.wav is a 8Khz 8bit Mono file.
You can now playback the files as follows:
o ossplay -v test1.wav and it should show you that the file is indeed 48Khz 16bit stereo.
o ossplay -v test2.wav - you should see that this file is indeed a 8Khz 8bit mono file.
What you have essentially accomplished is recording a single input stream into two different formats at the same time.
You can now extend this analogy to record the input in mp3 format and RealAudio format simultaneously.
The IMUX control panel can be displayed by typing ossxmix -d<imux mixer number> (for e.g. in the above example, IMUX mixer is #2 so we type
ossxmix -d2
There are record level control sliders for each input channel and it will show activity when a recording program is active on a particular
channel.
OPTIONS
o imux_masterdev: Selects which physical device to use as the Master device for the IMUX driver. Values: -1: automatically selected by
OSS, 1-N: Audio device index of the master device (as reported by ossinfo -a), Default: -1.
o imux_rate: Specifies what is the base sampling rate used by the imux driver. Values: 5000-96000 Default: 48000
o imux_devices: Specifies number of Input Multiplexer devices to setup. Values: 2-48 Default: 5
FILES
/etc/oss4/conf/oss_imux.conf Device configuration file
AUTHOR
4Front Technologies
16 December 2012 oss_imux(7)