General :: Grep: Return An User Message When No Hits?

Jun 13, 2011

I have ASCII files to parse that 48 hours old or more ; I can identify them like so

Code:
find . -name "FILE*TXT" -mtime +1 -exec ls -ltas '{}' ';'

Some files have a list of hardware errors (we test electronic components), some have none. If the file name has no errors, I still want to display a message like so

Code:
grep ^err R*VER && echo "No error"
FILEA.TXT:err->USB3910err
FILED.TXT:err No Error

This grep statement works but it seemingly overrides the find() statement above if I run both at the same time... How can I combine the two statements to create a report that lists the filename and error(s) like so

Code:
FILEA.TXT Button3320err
FILEB.TXT USB3235err
FILEC.TXT IR Remote2436err
FILED.TXT No error

Is it possible to return "No error" with the file name without error?

View 11 Replies


ADVERTISEMENT

Programming :: Tell If Grep Didn't Return Anything?

Mar 15, 2011

I have a file:

979798707
787862348
766428634

I want to see if all the records in the file are present in the contents of the files of a particular directory.

Basically I want to say if grep doesn't return anything, then report.

For example in /tmp dir I have 4 files and flast 2 values (787862348 and 766428634) are present in the files of /tmp dir, but first one (979798707) is not. I want to echo that in a reporting file.

something like:

while read line
do
# if ! grep -rl $line /tmp
echo $line >> are_not_present
done < "myFile"

How do I achieve " if ! grep -rl $line /tmp"? That is, if the line is found by grep, then grep will print the output, but if grep does'nt find it, it will print nothing. How can I check if grep didn't find it (i.e. printed nothing)?

View 2 Replies View Related

Ubuntu :: GREP - Return Only Search String?

Jan 13, 2011

I have a mail.log file, of which I want to redirect only the search strings of the sender from=<example.sender@exampledomain.com> and the size size=4537 to a file.

In every case the sender string starts as from=<> and the size string starts as size=

What would be the grep command to redirect only the two search strings to a .txt file?

View 2 Replies View Related

General :: Bourne Shell Input From File Using - Then Return Control To User?

May 5, 2011

I have a program that I run from the terminal that requires manual input (it's matlab in mex debugging mode, matlab -Dgdb, which starts the GNU C debugger with its own custom settings).

Every time I run this program I always type in the same few commands in the program's interactive shell before I actually start working (for example: run -nojvm; stop at mexFunction; continue). I want to avoid typing these commands and I thought I could do this with shell scripting, saving the commands in the mycommands file, then running: myprogram < mycommands

The problem is that this runs all the commands and then exits the program. I want it to run the commands and return control to me so I can run my commands. Is there a way to tell the shell to use a file or a string as the input to a program then immediately return control to the user without the exiting the program?

View 3 Replies View Related

Software :: Evolution E-mail Return To Inbox After Message Deleted

Dec 11, 2010

Is there an option in Evolution to return to the Inbox view after you delete a message, rather than going on to the next message? I cannot find it anywhere.Incidentally, this same question is one of the zero-reply questions: URL...I wonder if this means there is no such feature in Evolution and I should submit some kind of "feature request" at their development site.

View 4 Replies View Related

Server :: PostFix - ISPConfig Mail Return - Unknown User" Or "no Such User Here

Feb 9, 2010

I have set up a debian 5 server with ISPConfig and PostFix using Perfect Server toturial [url].

Now i have huge problem i'm getting eather "No such user here" message from SMTP server hosted at hosting provider or Unknow User: name from my ISP's SMTP server (free mails they provide)...

Mail LOG:

Code:

View 1 Replies View Related

Programming :: Tail The Message Log| Grep - Several Words - Play A Sound When It's Found

Jul 4, 2011

I'm trying to write a script that will either tail or watch /var/log/messages for the words

PHP Code:

signal Gone into alarm state

From this line below.

I would then like the script execute:

And have run at start up.

I'm stuck with grep-ping only one word

PHP Code:

View 14 Replies View Related

General :: Script To Tar Up Files When A Partition Hits A Certain Use Percentage

Apr 19, 2011

I am in need to create a script that queries how large a partition is and when it hits a certain percentage (say 90%) it will execute another script that tars up certain files (or they could just be part of the same script). I would create a cronjob that runs this script once a day.

I have the script that tars up the files I need, sets permissions, etc. (btw, the files in question are audit logs). I just need the part that runs something like a df -h and takes the use percentage of the /var partition in that query and if that percentage is greater than/ equal to 90%, it kicks off the tar script.

Here is a sniplet of the df -h with just the /var partition shown:

Quote:

So, when the cronjob sees that the Use% is >= 90%, it would kick off the tar script...if not above 90%, it closes.

View 14 Replies View Related

General :: Send Message To Other User In Shell?

Jun 22, 2009

how can i send message to other user in shelli try use write before but it say permission deny from user

View 2 Replies View Related

General :: Pidgin IRC Direct Message To A User

Jun 13, 2011

I notice that when people message me in a channel the message itself show up in the channel, but I also get notified from pidgin that I got a message. Now my question is, how do I send a message to a specific user so he gets notified like I do, but still the message show up in the channel. I know It's not Linux specific question, but IRC is in Linux culture anyway, and I been googling but for no solution at the end.

View 3 Replies View Related

General :: Capture Reponse Of 20 Different URL Hits In Single Shell Script?

Aug 5, 2010

I need to execute 20 urls in one shell script and display there responses on the console and write on text file too. consider the case when url is not responding.

View 4 Replies View Related

General :: How To Send Message To Local User Logged Into X11

Jul 13, 2011

Is possible to send a message (popup window or something) to local user logged into X (xdm, fluxbox) from console ? For example: user1 is logged and using X/fluxbox, user2 logging into the same box by ssh to console. Now - what user2 have to do to send message to user1 ?

View 1 Replies View Related

General :: Alert Message When A Specific User Is Login To The System?

Nov 25, 2009

Can advise if I want to have a alert message when a specific user is login to the system , what can I do ? that mean if a specific is login to system then send me a alert message ( by any way ) to inform me the user is login , what is the method ?

View 7 Replies View Related

Ubuntu Installation :: Former - User Cannot Return On His ASUS

Jul 20, 2011

Greetings beloved Linux users. I had grown accustomed to using Ubuntu on my laptop for the longest time when a nasty virus screwed up my boot sectors on my HP Desktop. I finally bought a nicer computer with Windows 7 back in November of 2010, but I'm having difficulties trying to install Ubuntu onto it. Here are some specs:

Model: Asus CM5571 Desktop PC 64-bit
Processor: Intel Pentium E5400 / 2.7 GHz Dual-Core (yes, a Pentium)
RAM: 6 GB DDR3 SDRAM
Graphics: Intel GMA X4500 Dynamic Video Memory Technology 5.0
Sound Card: Intel HD Audio

I'll be willing to provide more if needed So, I started off trying to load the Ubuntu 10.04 CD I received from the free shipping service off of the Ubuntu website, and that would not boot. It seemed to hang after trying to scan my 500 GB external. So I unplugged that,rebooted, and it seemed to hang on my USB hub. I unplug that, rebooted, and it hangs after trying to making "calls" or something to devices. Not sure at all what is going on there.

I figured I might need a 64-bit edition so I go to the website and burn an ISO of Ubuntu 10.10 64-bit. The same thing happens. I then begin experimenting with the boot options (acpi=off, etc.) and none of that seems to work either. Out of desperation, I find an old 8.04 CD and try to boot from that. It gets past the loading bar but boots into BusyBox only.

View 4 Replies View Related

General :: Disable Text Message "this Session Being Run As A Privlidged User"?

Mar 8, 2010

It is very annoying messing from GNOME.
I understand the risks of running Linux GUI as root but its not a problem.
tell me how to get rid of text message.

View 4 Replies View Related

General :: User For Oracle,tried To Install Oracle 10g On Redhat 5 But Gettinh The Same Error Message?

Nov 27, 2010

I'm a new user for oracle,tried to install oracle 10g on redhat linux 5 but gettinh the same error message.response/ runInstaller[oracle2@localhost database_10201]$ sh runInstaller _runInstaller: line 54:/tmp/database_10201/install/.oui: Permission denied_Doany one plz help me how to give full set of permisions to an user in linux to access a folder??

View 2 Replies View Related

Ubuntu Multimedia :: When Will VLC 1.1.10 Hits Natty

Jun 8, 2011

When vlc 1.1.10 hits natty, this is a minor security and bugs update so it should arrive soon officially?

View 5 Replies View Related

Programming :: Input File - Grep Within Grep

Nov 22, 2010

I need to kind of grep within grep. My input file would be something like:

[Code]....

and I need to find the first occurrence of hello before MY PATTERN (hello 9008 in this case), so the output should be:

[Code]....

View 4 Replies View Related

Networking :: See Whether Wget Can Be Used To Generate Actual Url Hits On A Webpage?

Jan 16, 2011

I am trying to see whether wget can be used to generate actual url hits on a webpage. This does not look good so far�. I changed the following lines in /etc/wgetrc to:

Code: http_proxy=http : / /<proxy_ip>:<port>/ use_proxy on Output :

Code: root# wget -c <url>/ > /dev/null
--2011-01-16 12:26:38-- <url>
Connecting to <proxy_ip>:<port>... connected.

[code]....

2011-01-16 12:26:39 (88,9 KB/s) - `index.html.3' saved [50548] This does NOT generate a hit on the actual web page! It does not seem like the, > /dev/null part is working either... How can I get this to work?

View 4 Replies View Related

Programming :: Script For Searching Through Messages For Multiple FTP Hits

Oct 25, 2010

My script looks really crap and messy, the logic isn't great and I'm not hugely happy with it. Also it echo's $i instead of an actual IP address (line 10). How to improve this. It basically searches through /var/log/messages for multiple FTP hits and when the hit count is higher than a specific number the IP is added to a config file and ftp is restarted. There are some obvious flaws in my script.

Code:
MAXHITS=0
TOPHITS=`grep "FTP session closed." /var/log/messages* | awk '{print $7}' | sed -e 's/^.*[//' -e 's/].*$//' | uniq -c | sort -nr`
HITNUMB=`echo $TOPHITS | awk '{print $1}'`
IPHIT=`echo $TOPHITS | awk '{print$2}'`
HIGHIP=`echo $TOPHITS | grep $HITNUMB | grep $IPHIT | awk '{print $2}'`

if [ $HITNUMB -gt $MAXHITS ]; then
for i in $HIGHIP;
do
echo $i
sed -i '78s/$/,$i/' /opt/etc/proftpd.conf
/root/ftp restart
done
else
echo "not greater than $MAXHITS"
fi

I'm not even sure what will happen if I get multiple responses for my $TOPHITS. It would be cool if it could search for IP's already blacklisted somehow, it might actually be easier to just create a file with a set of blacklisted IP's or something.

View 14 Replies View Related

Programming :: Script To Search And Count Hits From Some Country

Mar 25, 2011

I need something to make a script that will search some logs and extract IP hits from one country only. Let's say UK. I guess I need to use GeoIP or some database. I just need a very simple bash, perl, php script that will do this job. Just search threw logs (apache) and then give me number of hits found from UK.

View 5 Replies View Related

Slackware :: Lazy Kernel Compiler Hits Snag?

Feb 22, 2010

I haven't recompiled ny kernel in a while, but whenever I did it, it was all pretty easy. Make menuconfig; (adjust); make && make modules_install, and copy over bzImage in */arch/* and System.map to /boot and stick in new entry into grub menu.lst.However, this time, I must be missing something, because I get kernel panic on booting up to the new kernel. Is there a step I'm missing?Certainly, I was looking in /etc/rc.d and there is a rc.modules<kernelver> script in there. I wondered if I need make a new one ... although when I looked over it, it seem only to be required when forcing particular modules.

View 14 Replies View Related

OpenSUSE Hardware :: Tablet The Mouse Hits The Top Left Corner & 11.3

Aug 31, 2010

In OpenSuSE11.2 I followed this url to got it to work: Genius MousePen 8x6 It worked like a charm. In OpenSuSe 11.3 the Xorg stuff is different. In /etc/X11/xorg.conf.d there is a wizardpen.conf but when I use the tablet the mouse hits the top left corner. Using the settings from the url above doesn't make it work either.

View 4 Replies View Related

Ubuntu :: Sending Message To Specific User?

Apr 8, 2011

Is it possible to send a message to a specific user of group with "wall" command? Seems that this command will broadcast the message.

View 3 Replies View Related

Debian Multimedia :: Send A Message To Other User With Ssh And Notify That?

Jun 14, 2011

Let's say there are machines A and B. user1 is on machine A, and has access to machine B through ssh (also as user1). user2 is sitting at machine B (let's say in Gnome session). And user1 has sudo access on machine B. How can user1 send a message to user2 (so it should appear on user2's desktop) with notify-send? code...

This doesn't work. I get in result:
(notify-send:28676): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed
What else should be done to make it work? (trying it on current Debian testing).

View 3 Replies View Related

OpenSUSE :: Error Message Saying Installation Aborted By User

Apr 10, 2010

I am running OpenSuse 11.2 i586 on a HP Laptop

I am trying to update, but It keeps giving me these error messages, How can I fix these?

It also gives me an error message saying Installation Aborted By User when i haven't...

Subprocess failed. Error: RPM failed: rpmdb: PANIC: Invalid argument
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30977) from dbcursor->c_put: DB_RUNRECOVERY: Fatal error, run database recovery
error: error(-30977) storing record into Provideversion

[Code].....

View 1 Replies View Related

Ubuntu :: Display Message To And Accept Input From User?

Jul 4, 2010

I am using LuckyBackup to back up my laptop disk to a USB disk. I would like to display to the user the message "Please mount backup disk" and have the user click "OK". LuckyBackup has a feature to allow issuing commands before it does the backup. I have been investigating scripts (I have never written one.), but do not understand how to use them to this end.

View 4 Replies View Related

Debian Installation :: Install Kde Properly - Get An Error Message Because Of Invalid User

Mar 26, 2010

Ive just installed Debian Lenny and then fglrx and kde, but if i try to login to kde, i get an error message because of invalid user. Do I have to enable my user first to login to kde or something?

View 4 Replies View Related

Server :: Postfix: Customized Reject Message Per Virtual Domain (or User)?

Jul 30, 2010

I have a mail server taking care of mail for my 4 domains; the first is used for virtually all mail, the second rarely used anymore, the third is virtually 100% spam the past year(?), and the fourth isn't in use (and never has been, so no spam). What I'd like to do is to reject all mail to the third domain. Right now this is what I get (I tried to send to a nonexistent address from gmail):

[code]....

Since my username (xyz@) is the same for all domains, I could (or so I hope) change the reject message to give a hint to replace [URL] with [URL] and try again.

View 2 Replies View Related

General :: Alt-ctrl-f1 / Would Not Return To A Gui?

Aug 12, 2009

ok, I pressed alt-ctrl-f1 and it displayed my screen with a gui. I then pressed alt-ctrl-f2 and it displayed a textual desktop. I pressed alt-ctrl-f3 and it displayed the same thing. When I pressed alt-ctrl-f1 to return to my gui, it would not let me return to a gui. I was stuck in a cmd line textual desktop.

How, without restarting, do i return to a gui once I press alt-ctrl-f2??

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved