General :: Set Variable In Procmailrc Action Block?
May 2, 2011
I want to know how to set variable in procmailrc action block or condition block I want to set a variable as a random file name to store emails but I don't know how to set a variable in procmailrc action block or condition block .this is my example:Quote:
:0b
* ^FROM.*
{
code]...
View 2 Replies
ADVERTISEMENT
May 2, 2011
How can I have ELSE condition in procmailrc I mean if the mail was from X and Subject has Y OR .... DO something ELSE DO SOMETHING ELSE. I do not want to use two different conditions for each state I want use just one condition and its ELSE because putting too recipes in procmailrc make it too slow .
View 2 Replies
View Related
May 2, 2011
I want to generate random name for email file name to prevent overwriting but $RANDOM ENV VARs does not work in it what can I do? this is my procmailrc:
Quote:
SHELL=/bin/bash
SUBJECT=`formail -xSubject:`
FROM=`formail -xFrom:`
SUBJECT=`echo $SUBJECT | sed -e 's/ /-/g'`
FROM=`echo $FROM | sed -e 's/.*<//g' | sed -e 's/>//g' | sed -e 's/@/AT/g'`
STOREFILE=20`date +%y-%m-%d_%H-%M-%S`_${FROM}_${SUBJECT}_${RANDOM}${RAMDOM}
it works fine except ${RANDOM}${RAMDOM} and I do not want to use mktemp command .
View 8 Replies
View Related
Apr 19, 2011
I want to know how can I use sender an receiver of the email in name of file for storing mail in procmailrc. I made one but it does not work.
Quote:
SUBJECT=`formail -xSubject:` # regular field
FROM=`formail -rt -xTo:` # special case
:0 b
* ^FROM.*
| sed -e '/^To: +?[0-9]*$/,/report/!d' > ${FROM}${SUBJECT}--`mktemp 20`date +%y-%m-%d-%S--`XXXXXX`
it works when I use :
Quote:
| sed -e '/^To: +?[0-9]*$/,/report/!d' > `mktemp 20`date +%y-%m-%d-%S--`XXXXXX`
View 1 Replies
View Related
Apr 26, 2010
I try to get uuid value from variable block got from menu.lst.This try does not work. What is wrong?
Code:
uuid=$( echo $block | awk --re-interval '/(root=UUID=/{ x=gensub(/([0-9a-f-]{36,36})/,"\1","g");
print $1}')
View 14 Replies
View Related
Feb 13, 2009
I'm setting up a machine that's going to be used to test randomly connected tape drives one at a time, and as such, I'm writing the test routine using mt in a bash script, for user-friendliness. The problem is the block device name changes on occasion as tape drives are swapped out and busses are rescanned, so I can't "hard code" a block name into the script.
I know programs like lsscsi and hwinfo will give you block device names as part of their output, but I can't seem to grep anything in such a way as to have the final output be just the block name (ie /dev/st2, or optimally 'st2'), so that I can just have the script read said output, and drop it into the necessary variable.
View 2 Replies
View Related
Feb 17, 2011
how to assign a local variable value to a global variable....
View 2 Replies
View Related
Apr 16, 2011
I am supposed to create an environment variable with the PRINTER variable, which should resolve to the word sales. Would the command be like this?: env PRINTER - NAME=SALES (is this the command to create that variable with resolving the word sales to it?)
View 3 Replies
View Related
Jul 25, 2010
can i use the value of one variable to generate a name for another variable? for example i want to use the counter from a "do while" loop to name and define a variable each time the loop executes. for example
objectnames1=`ls -a`
objectnames2=`ls -a`
etc.
i don't have a script yet but each time through the loop i intend to cd to a particular directory and then define a variable containing a list of each object in that directory as values. for the rest of the script to work, each variable generated has to be unique, and i can't think of a good way to accomplish this.
if using a value from one variable to name another isn't possible, can anyone think of a more elegant solution? i know limited syntax but i'm willing to read up...
View 6 Replies
View Related
Dec 27, 2010
I am trying to alter the character position of residue numbers above 999 in a pdb file.The following script is an attempt to:1) Get all unique pdb residue numbers (in column 5) using awk and assign it to a variable i.2) Loop through all the values in $i and if it is greater than 999, shift that number one character to the right using sed.However, the script only manages to alter the final residue numberCould anyone please advise how I can loop through all values in $i and shift it one character to the right?
#!/bin/bash
# Script to alter position of residue number in pdb file for resid above 999
i=$(awk '{print $5}' wt-test.pdb | uniq)
[code]...
View 6 Replies
View Related
Feb 4, 2011
I have a server with logs running. People connect to server. This server is running the same application as a failover just in case it stops. I have a doubt that some clients are connecting from different places as the nodeID is changed SO I need to make a script which reads both logs that are called server1.log and server2.log and where it finds a nodeID which does not match in both logs it action with fail2ban
I don't know whether this can be done directly via fail2ban since it is the program which I know that reads between logs but as far as I know it cannot match data with another log
This is an Example:
Code:
Log 1
03:00:08.905 client qwe696s@894b226f7846d9df, running version 2.1
Log 2
03:00:08.905 client qwe696s@894b226f7846d9dd, running version 2.1
Quote:
qwe696s is the username
894b226f7846d9df is the NODEID
AS you can see from the logs nodeid is different
View 5 Replies
View Related
Jan 11, 2010
I have security guidelines for my business OS which require me to active screensaver.
Nevertheless, I dislike screensavers because I sometime read a while, but I do not want to go offline from my IM in the meantime.
Anyways, I am looking for a solution. So I though about writing a little shell script (connected with a cronjob), which just moves the mouse every 10 minutes or so.
Unfortunately, I have no clue how to interact with the mouse in a shell script.
View 4 Replies
View Related
Mar 22, 2010
I have a following string."machine=IFLMUD5HP0581&group1=Stop"I have created 2 variables namely machine and action.machine should containIFLMUD5HP0581action should containStop
View 7 Replies
View Related
Mar 14, 2011
When I try something like
php -i | less
Less is not responding to hotkeys, but prints them like pressing "q" results in statusline
:q
PageDown
:^[[6~
Pressing ENTER like "executes" the keycode and less perfoems the action. Piping trivial small stuff work however... OS: Fedora 14
View 1 Replies
View Related
May 20, 2011
I use the Actions feature of KDE's Klipper utility to run certain commands when I copy something into the clipboard that matches a particular regular expression. Unfortunately, I have to turn on Enable Clipboard Actions and select the command from a menu every time I copy something that I want to run the command on. I'd like to have that command run automatically instead.
You'd think this was possible, as there is an automatic checkbox in the action settings dialog box:
Unfortunately, that appears to do nothing. The documentation included with Klipper does not indicate what that checkbox is supposed to do.
Is it possible to configure Klipper to run a command automatically if the contents of the clipboard matches a regular expression? If not, is there another way to accomplish this?
View 1 Replies
View Related
Feb 1, 2010
I want to use a combination that avoids alphabetic/punctuation characters because that way I have a consistent physical position on different layouts. Control_R+Menu fits that requirement and is also located at a very convenient position.This combination used to work in KDE 3.5 for the global kxkb switch action, or any keyboard action for that matter. In KDE 4, trying to assign Menu by pressing the Menu key always activates the keyboard trap widget's context menu, in this case giving me the What's this?How do I work around that problem? Alternatively, do you have a snippet that I can paste into $HOME/.kde/share/config/kglobalshortcutsrc and which works?
View 1 Replies
View Related
Dec 8, 2010
I want window to be closed when i middle click on the corresponding taskbar item. Can this is be configured in KDE4?
View 1 Replies
View Related
Feb 17, 2010
i recently install openoffice in fedora 12 and error occured the error is : the action could not be completed because the name org.freedesktop.packagekit was not provided by any .service files. what is link to download latest openoffice for my fedora 12,?my laptop model is asus k50in.
View 1 Replies
View Related
Aug 21, 2009
I'm trying to read content of file to variable and use this variable in for loop. The problem is, when I have c++ comment style in file - /*. Spaces in line are also interpreted as separated lines.
For example:
Code:
Changing $files to "$files" eliminate these problems but causes that whole content of variable is treated as one string (one execution of loop).
View 6 Replies
View Related
Apr 7, 2010
my script has a variable which comes in the form +00.00 +0.00 -00.00 or -0.00 (the numbers can be any in that form) for any that have a + symbol I need to remove the +, but if it has a - symbol it needs to stay.
i need to make a new variable with the string from the old variable btut without any plus sign. I have tried a lot of different ways with no success, each thing I tried either left the + or removed the entire string. I think this should work but doesn't
foo=+12.40
bar=${foo#+}
View 4 Replies
View Related
Jun 10, 2009
I have a text file i that has a mailTo: NAME in it. In a bash script i need to extract NAME and put it in a $variable to use. How do i do this?
View 2 Replies
View Related
Apr 25, 2011
how I can search within a variable and assign the results to a new variable. I'll use the following as an example -
cars="Audi BMW Cadillac Chevy Dodge Ferrari Ford Mercedes"
list=`echo ${cars} | egrep -o '<A?+|<C+'`
with the echo command I get the following output assigned to list -
A
C
C
What I'd like to get for output is -
Audi
Cadillac
Chevy
how I could do this regardless of upper/lower case letters?
View 5 Replies
View Related
Dec 8, 2009
On one of my servers I see this when I log in. What does this mean and how can I get it to go away? Everything seems to work fine, but none of my other machines give this error.
View 5 Replies
View Related
Apr 28, 2010
included shell script inside c program, and i wanted to assign the value of c variable to shell variable..Can any one please suggest me how to do it?
View 8 Replies
View Related
Mar 17, 2011
This loop is part of a bash script which takes multiple arguments.
Code:
for ((i=1;i<=$number;++i)) ; do
offset=$(($i+5))
[code]...
View 3 Replies
View Related
Jan 28, 2010
Recently I have upgraded my archlinux and then my compiz is strange. When I press Alt key, the window menu, which contains "minimize", "close" and others, will pop up. This strange action disabled all shortcutd that need Alt key, such as Alt-Tab, and even key bindings in VIM. Is there any who can tell me what causes it? And which configuration is related to the keyboard action in compiz?
View 2 Replies
View Related
Jul 23, 2011
I have recently set up a new site, and I find recently the host is not quite responding to request when I ssh to the host or just hit my site's url. I think I could be under some kind of DoS attack, because I do not think google's crawling can cause that problem. Is there any way I can figure out who is doing that? I am not quite expert for apache, and I just barely know how to install it.
Also, how can I block particular ip from the server.
View 1 Replies
View Related
May 30, 2010
I m using FC10 in my laptop. I have 3 users (including root), and i m using internet browseing, through broadband connection (like, TATA Fotone), through my USB port. I want to block only "orkut, & facebook" to my user1 and user2.
View 2 Replies
View Related
Mar 14, 2011
After installing BOT everything was blocked when I enabled BOT.After trying out some rules I can't block anything anymore.What have I done wrong?I have tried to remove all rules but still I have full access to Internet.Is there a IPCop BOT for Dummies to buy or something similar on Internet?
View 1 Replies
View Related
Jan 14, 2010
By mistake I have modified the PATH variable you know what a kind of mess it is.
Code:
echo $PATH
I just need to set the path variable again so I just need the format. Or can anybody come up with how to set the path variable.
View 6 Replies
View Related