Programming :: Print A Message When A Diff Shows Files Match?
Jul 16, 2009
I'm writing a script using ksh that diffs two dirs that contain about 30 files, and writing the results on a logfile. When files differ, it writes the difference with no problem, but I also need the script to write a message if no differences are found.
I cannot print pdf files. I have tried using okular and xpdf. The documents display in the program, but print preview shows a blank page. The printer then sends out blank pages. I have tried printing on 2 different printers using usb cables. Using terminal to process the commands shows error:
I need some direction on a small scripting question. I've been doing some development and storing the code on a network drive with multiple user access. My development is getting complex enough that it is time to set up a svn repo for it. I would like to set up a little script (if possible) that prints a message/reminder to whomever is accessing the code directory stating that the code is ultimately stored in svn and any changes need to be checked in, etc. Is there a way to have linux print a message to the screen based on a 'cd /specific_dir/' command? So far google is mum on the topic. Using Debian and bash shell.
I initially had a problem accessing the CUPS interface (see my other post) and got that resolved by adding the user "cupsys". Now, everything "looks" ok, and when I print a test page, it shows it as completed (in CUPS). However, the page never prints. The printer is a Canon MP600 (using the canonmp600en.ppd file to configure it). Here's the output of my conf file.
Code: # Show troubleshooting information in error_log. LogLevel debug
Code: $sql="SELECT table1.datetime, table1.user_id, table2.ip, FROM table1,table2 WHERE id='$id' AND (table1.id = table2.id AND table1.datetime = table2.datetime)";
In table2 the datetime fields are about 1 to 2 seconds off due to the source of the data, which I cannot change.
Is it possible via a query match table1.datetime & table2.datetime by HH:MM (ie. to the minute instead of to the second)?
Our one remaining problem seems to be printing. She has an HP OfficeJet 6500 USB printer. We have the computer conntected. Strangely, when I boot from the CD the printer shows up as installed even though I did nothing to install it. After having submitted a print job it shows the printer status as "idle" and the print queue is empty. I tried deleting that printer and re-installing. The installation went as one would expect. However the results are the same. I'm beginning to think that somehow the problem is related to the fact that we are operating from the live CD. getting this thing to print from the live CD.
I would like to make a one-liner, which diff's "ps aux" output before and after killing a process. So basically it should be a combination of fallowing commands: 1) diff -u 2) ps aux | awk '{print $2}' 3) kill `ps aux | grep [c]ron | awk '{print $2}'` 4) ps aux | awk '{print $2}'
How to achieve this? Something like this: Code: diff $( kill `ps aux | grep [c]ron | awk '{print $2}'` && ps aux | awk '{print $2}' ) $( ps aux | awk '{print $2}' ) I don't have pgrep or pkill available.
I'm new to scripting and I have a trouble with if statement syntax. The code is: Code: #there is a diff command here, and it does what i want but#i wanna see 1 if the exit value of diff is 0, and otherwise i wanna see 0.#the problem is here: (syntax error near unexpected token "then")
i tried using diff --GTYPE-group-format= with <%, but not sure that right solution.Here's what im trying to do. I have two c source files, file1 and file2. file1 has a function in it that's been modified in file2. However, the functions begin at differnt line numbers in eachof the files. Is there a way to specify a range of file numbers on file1 and file2 to compare, using diff or any other combination of utilities? I can always output text from a range of lines from each file to two separate and new files and then compare those, but that's tedious. I could also write up a script to automate this type of solution, but I imagine there's an existing way of doing this.
I have installed CentOS 5.5 to prepare for my RHEL certification. I have a Epson T11 printer. It shows Epson T11 ready when I try to print something. But it never prints. I tried lpq also. But no success. The following is the error I get:
The printer prints with ubuntu live cd. I deleted the printer from the list and I followed the instructions here. When I tried to print, sometimes it shows that the documents was printed (but my printer is standby) sometimes it shows the document failed.
Any time I watch a screencast dealing with notifications, there are always multiple of them on the screen. But when I have a program that uses them it always just allows one at a time.
i changed my password and whenever i log in i get a message that ur login keyring password and user password do not match, so how do i change my login keyring password!!
I have windows 7 and ubuntu karmic dual boot system.i can easily transfer files via bluetooth in windows 7 but in ubuntu it shows a message bluetooth adapter not connected while as i dont use any such adapter while working in windows .
I need to edit the sudo file on lots of machines. I figure the easiest way is to run a for loop to ssh to each box, sed the sudoers file to a new file & copy/move back over the top of the original (and of course, change permissions accordingly)
The problem is, I'm not sure how to add a line after a match with sed.
So if my file looks like:
Code:
I'd like it to add the new sudoer after "other" so the file looks like:
i am using red hat linux 5.0 when i start my computer it shows me the message ofINIT:No inittab file foundEnter run level:i dont what to enter here if anybody know then
how I can match a literal string in awk i.e. making awk to *not* interpret the characters coressponding to its builtin operators in a given string. Take this code:
i have an sql table with 2 columns i run a script that randomly selects a word from the table in column 1. the word is displayed on the screen and I guess what it means i concatenate the randomly selected word and the answer the script looks for a match in mysql if it finds a match it says "Good job!" if there is no match it will say "not correct". However when i get it right it says not correct even though when i echo the variables they look exactly the same. the script below:
#!/bin/bash var=$(mysql translator -u root --password=*-N<<EOF SELECT word FROM tagalog ORDER BY RAND() LIMIT 1 EOF )
My problem is like this I have to delete all lines between two pattern match example- suppose below is the content of the file then i have to delete all lines between text1 and text2