Sponsored Content
Operating Systems Linux Linux command to find and replace occurance of more than two equal sign with "==" from XML file. Post 302678357 by neutronscott on Friday 27th of July 2012 04:33:45 PM
Old 07-27-2012
i was under the impression ed does it right.

Code:
mute@goflex:~$ ls -li input && cat input
7345 -rw-r--r-- 1 mute mute 38 Jul 27 20:32 input
line1 =
line2 ==
line3 ===
line4 ====
mute@goflex:~$ printf '%s\n' 'g/===*/s//==/g' w q | ed -s input
mute@goflex:~$ ls -li input && cat input
7345 -rw-r--r-- 1 mute mute 35 Jul 27 20:32 input
line1 =
line2 ==
line3 ==
line4 ==

posix, but not wasn't installed on debian squeeze minimal..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

"find command" to find the files in the current directories but not in the "subdir"

Dear friends, please tell me how to find the files which are existing in the current directory, but it sholud not search in the sub directories.. it is like this, current directory contains file1, file2, file3, dir1, dir2 and dir1 conatins file4, file5 and dir2 contains file6,... (9 Replies)
Discussion started by: swamymns
9 Replies

2. Shell Programming and Scripting

Interesting question - Search and replace the word after sign "="

Hi Guys, Req your help in searching and replacing the word that comes after equals(=) symbol I would like to replace the sting in bold with a string in variable. d=ABCDF8C44C22 # grep -i NIM_MASTERID ${_NIMINFO} export NIM_MASTERID=00CDF8C44C00 I'm looking to replace any word that... (4 Replies)
Discussion started by: ajilesh
4 Replies

3. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

4. UNIX for Dummies Questions & Answers

replace "," with "." only in specific columns of a file?

Hi all, I have this text file containing 9 columns separated by space. The 8th columns contains the numbers. C1 C2 C3 C4 C5 C6 C7 C8 C9 er rt yt gh iu nk il 0.07 xs yt lr ty bg iu zk nh 0,0005 lt ...etc. I want to replace the comma with full stop only in 8th coloumn. the output... (8 Replies)
Discussion started by: Unilearn
8 Replies

5. Shell Programming and Scripting

Problem with "find" and "grep" command

I want to list all files/lines which except those which contain the pattern ' /proc/' OR ' /sys/' (mind the leading blank). In a first approach I coded: find / -exec ls -ld {} | grep -v ' /proc/| /sys/' \; > /tmp/list.txt But this doesn't work. I got an error (under Ubuntu): grep:... (5 Replies)
Discussion started by: pstein
5 Replies

6. Ubuntu

How to change "more" to "more or equal" in this line?

Hi, Below line selects only dates comes after than today. I need to change below line as "more or equal": awk -F\## -v d=$(date +%Y%m%d) '{if($NF>d)print}' /usr/batch/pill.txt > /usr/batch/pill_in_use.txt When we change the code, it will print today's date and following dates only. ... (2 Replies)
Discussion started by: baris35
2 Replies

7. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

8. Shell Programming and Scripting

Delete all log files older than 10 day and whose first string of the first line is "MSH" or "<?xml"

Dear Ladies & Gents, I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out: for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies

9. UNIX for Beginners Questions & Answers

How do I redirect output from "find", either to a file or another command?

I'm trying to find out what happened to the rogue game that apt-get told me it installed, so I thought I would find the file. I went to the root and entered: find -name "rog*.*" I get a large number of lines saying my access is denied in various directories. I figure I'll practice my Unix... (14 Replies)
Discussion started by: arghvark
14 Replies
pactl(1)						      General Commands Manual							  pactl(1)

NAME
pactl - Control a running PulseAudio sound server SYNOPSIS
pactl [options] COMMAND [ARGS ...] pactl --help pactl --version DESCRIPTION
pactl can be used to issue control commands to the PulseAudio sound server. pactl only exposes a subset of the available operations. For the full set use the pacmd(1). OPTIONS
-h | --help Show help. --version Show version information. -s | --server=SERVER Choose the server to connect to. -n | --client-name=NAME Specify the client name pactl shall pass to the server when connecting. COMMANDS
stat [short] Dump a few statistics about the memory usage of the PulseAudio daemon. (Note: for backwards compatibility, we also show the output of the info command. In order to only show statistics, use the optional short argument. In a future version of PA we will make this the default) info Dump some info about the PulseAudio daemon. list [short] [TYPE] Dump all currently loaded modules, available sinks, sources, streams, etc. TYPE must be one of: modules, sinks, sources, sink- inputs, source-outputs, clients, samples, cards. If not specified, all info is listed. If short is given, output is in a tabular format, for easy parsing by scripts. exit Asks the PulseAudio server to terminate. upload-sample FILENAME [NAME] Upload a sound from the specified audio file into the sample cache. The file types supported are those understood by libsndfile. The sample in the cache is named after the audio file, unless the name is explicitly specified. play-sample NAME [SINK] Play the specified sample from the sample cache. It is played on the default sink, unless the symbolic name or the numerical index of the sink to play it on is specified. remove-sample NAME Remove the specified sample from the sample cache. load-module NAME [ARGUMENTS ...] Load the specified module with the specified arguments into the running sound server. Prints the numeric index of the module just loaded to STDOUT. You can use it to unload the module later. unload-module ID|NAME Unload the module instance identified by the specified numeric index or unload all modules by the specified name. move-sink-input ID SINK Move the specified playback stream (identified by its numerical index) to the specified sink (identified by its symbolic name or numerical index). move-source-output ID SOURCE Move the specified recording stream (identified by its numerical index) to the specified source (identified by its symbolic name or numerical index). suspend-sink SINK 1|0 Suspend or resume the specified sink (which my be specified either by its symbolic name, or by its numeric index), depending whether 1 (suspend) or 0 (resume) is passed as last argument. Suspending a sink will pause all playback. Depending on the module implement- ing the sink this might have the effect that the underlying device is closed, making it available for other applications to use. The exact behaviour depends on the module. suspend-source SOURCE 1|0 Suspend or resume the specified source (which my be specified either by its symbolic name, or by its numeric index), depending whether 1 (suspend) or 0 (resume) is passed as last argument. Suspending a source will pause all capturing. Depending on the module implementing the source this might have the effect that the underlying device is closed, making it available for other applications to use. The exact behaviour depends on the module. set-card-profile CARD PROFILE Set the specified card (identified by its symbolic name or numerical index) to the specified profile (identified by its symbolic name). set-sink-port SINK PORT Set the specified sink (identified by its symbolic name or numerical index) to the specified port (identified by its symbolic name). set-source-port SOURCE PORT Set the specified source (identified by its symbolic name or numerical index) to the specified port (identified by its symbolic name). set-port-latency-offset CARD PORT OFFSET Set a latency offset to a specified port (identified by its symbolic name) that belongs to a card (identified by its symbolic name or numerical index). OFFSET is a number which represents the latency offset in microseconds set-sink-volume SINK VOLUME Set the volume of the specified sink (identified by its symbolic name or numerical index). VOLUME can be specified as an integer (e.g. 2000, 16384), a linear factor (e.g. 0.4, 1.100), a percentage (e.g. 10%, 100%) or a decibel value (e.g. 0dB, 20dB). If the volume specification start with a + or - the volume adjustment will be relative to the current sink volume. set-source-volume SOURCE VOLUME Set the volume of the specified source (identified by its symbolic name or numerical index). VOLUME can be specified as an integer (e.g. 2000, 16384), a linear factor (e.g. 0.4, 1.100), a percentage (e.g. 10%, 100%) or a decibel value (e.g. 0dB, 20dB). If the volume specification start with a + or - the volume adjustment will be relative to the current source volume. set-sink-input-volume INPUT VOLUME Set the volume of the specified sink input (identified by its numerical index). VOLUME can be specified as an integer (e.g. 2000, 16384), a linear factor (e.g. 0.4, 1.100), a percentage (e.g. 10%, 100%) or a decibel value (e.g. 0dB, 20dB). If the volume specifi- cation start with a + or - the volume adjustment will be relative to the current sink input volume. set-source-output-volume OUTPUT VOLUME Set the volume of the specified source output (identified by its numerical index). VOLUME can be specified as an integer (e.g. 2000, 16384), a linear factor (e.g. 0.4, 1.100), a percentage (e.g. 10%, 100%) or a decibel value (e.g. 0dB, 20dB). If the volume specifi- cation start with a + or - the volume adjustment will be relative to the current source output volume. set-sink-mute SINK 1|0 Set the mute status of the specified sink (identified by its symbolic name or numerical index). set-source-mute SOURCE 1|0 Set the mute status of the specified source (identified by its symbolic name or numerical index). set-sink-input-mute INPUT 1|0 Set the mute status of the specified sink input (identified by its numerical index). set-source-output-mute INPUT 1|0 Set the mute status of the specified source output (identified by its numerical index). set-sink-formats SINK FORMATS Set the supported formats of the specified sink (identified by its numerical index) if supported by the sink. FORMATS is specified as a semi-colon (;) separated list of formats in the form 'encoding[, key1=value1, key2=value2, ...]' (for example, AC3 at 32000, 44100 and 48000 Hz would be specified as 'ac3-iec61937, format.rate = "[ 32000, 44100, 48000 ]"'). subscribe Subscribe to events, pactl does not exit by itself, but keeps waiting for new events. AUTHORS
The PulseAudio Developers <pulseaudio-discuss (at) lists (dot) freedesktop (dot) org>; PulseAudio is available from http://pulseaudio.org/ SEE ALSO
pulseaudio(1), pacmd(1) Manuals User pactl(1)
All times are GMT -4. The time now is 02:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy