Hello,
i have another sed question.. I'm trying to do variable substition with sed and i'm running into a problem.
my var1 is a string constructed like this:
filename1 filerev1 filepath1
my var2 is another string constructed like this:
filename2 filerev2 filepath2
when i do... (2 Replies)
I want to instert Category:XXXXX into the 2. line
something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong:
sed "2i\\${n}Category:$cat\n"
Sample:
Titel Blahh Blahh abllk sdhsd sjdhf
Blahh Blah Blahh
Blahh
Should look like... (2 Replies)
Hi all,
I have a variable say var1 (output from somewhere, which I can't change)which store something like this:
echo $var1
name=fred
age=25
address="123 abc"
password=pass1234
how can I make the variable $name, $age, $address and $password contain the info?
I mean do this in a... (1 Reply)
Dear all,
I have basic knowledge of Unix script and her I am trying to process variable length and variable format CSV file.
The file length will depend on the numbers of Earnings/Deductions/Direct Deposits.
And
The format will depend on whether it is Earnings/Deductions or Direct Deposits... (2 Replies)
Hi,
I am trying to do the following thing
var='date'
$var
Above command substitutes date for and in turn runs the date command and i am getting the todays date value.
I am trying to do the same thing as following, but facing some problems,
unique_host_pro="sed -e ' /#/d'... (3 Replies)
can anyone please help me with this:
i have written a shell script and a stored procedure which has one OUT parameter. now i want to use that out parameter as an input to the unix script but i am getting an error as variable not found. below are the unix scripts and stored procedure...
... (4 Replies)
Hi all,
Hereby wish to have your advise for below:
Main concept is
I intend to get current directory of my script file.
This script file will be copied to /etc/init.d.
A string in this copy will be replaced with current directory value.
Below is original script file:
... (6 Replies)
Hi All,
I have a file which has hundred of records with fixed number of fields. In each record there is set of 8 characters which represent the duration of that activity. I want to sum up the duration present in all the records for a report. The problem is the duration changes per record so I... (5 Replies)
I have a below syntax its working fine...
var12=$(ps -ef | grep apache | awk '{print $2,$4}')
Im getting expected output as below:
printf "%b\n" "${VAR12}"
dell 123
dell 456
dell 457
Now I wrote a while loop.. the output of VAR12 should be passed as input parameters to while loop and results... (5 Replies)
Discussion started by: sam@sam
5 Replies
LEARN ABOUT SUSE
withlist
withlist(8) System Manager's Manual withlist(8)NAME
withlist - General framework for interacting with a mailing list object.
SYNOPSIS
withlist [options] listname [args ...]
There are two ways to use this script: interactively or programmatically. Using it interactively allows you to play with, examine and mod-
ify a MailList object from Python's interactive interpreter. When running interactively, a MailList object called `m' will be available in
the global namespace. It also loads the class MailList into the global namespace.
Programmatically, you can write a function to operate on a MailList object, and this script will take care of the housekeeping (see below
for examples). In that case, the general usage syntax is:
OPTIONS -l, --lock
Lock the list when opening. Normally the list is opened unlocked (e.g. for read-only operations). You can always lock the file
after the fact by typing `m.Lock()'
Note that if you use this option, you should explicitly call m.Save() before exiting, since the interpreter's clean up procedure
will not automatically save changes to the MailList object (but it will unlock the list).
-i, --interactive
Leaves you at an interactive prompt after all other processing is complete. This is the default unless the -r option is given.
-r [module.]callable, --run [module.]callable
This can be used to run a script with the opened MailList object. This works by attempting to import module (which must already be
accessible on your sys.path), and then calling callable from the module. callable can be a class or function; it is called with the
MailList object as the first argument. If additional args are given on the command line, they are passed as subsequent positional
args to the callable.
Note that module. is optional; if it is omitted then a module with the name callable will be imported.
The global variable `r' will be set to the results of this call.
-a, --all
This option only works with the -r option. Use this if you want to execute the script on all mailing lists. When you use -a you
should not include a listname argument on the command line. The variable `r' will be a list of all the results.
-q, --quiet
Suppress all status messages.
-h, --help
Print a small help text and exit
EXAMPLES
Here's an example of how to use the -r option. Say you have a file in the Mailman installation directory called `listaddr.py', with the
following two functions:
def listaddr(mlist):
print mlist.GetListEmail()
def requestaddr(mlist):
print mlist.GetRequestEmail()
Now, from the command line you can print the list's posting address by running the following from the command line:
% bin/withlist -r listaddr mylist
Loading list: mylist (unlocked)
Importing listaddr ...
Running listaddr.listaddr() ...
mylist@myhost.com
And you can print the list's request address by running:
% bin/withlist -r listaddr.requestaddr mylist
Loading list: mylist (unlocked)
Importing listaddr ...
Running listaddr.requestaddr() ...
mylist-request@myhost.com
As another example, say you wanted to change the password for a particular user on a particular list. You could put the following function
in a file called `changepw.py':
from Mailman.Errors import NotAMemberError
def changepw(mlist, addr, newpasswd):
try:
mlist.setMemberPassword(addr, newpasswd)
mlist.Save()
except NotAMemberError:
print 'No address matched:', addr
and run this from the command line:
% bin/withlist -l -r changepw mylist somebody@somewhere.org foobar
AUTHOR
Author of Mailman is the Mailman Cabal, see http://www.list.org/ for information. This manpage is written for Debian by Bernd S. Brentrup
<bsb@debian.org>.
SEE ALSO
Mailman documentation on http://www.list.org/ and in /usr/share/doc/mailman.
2004-03-24 withlist(8)