Software :: Script That Prints Text File To Disk As PDF?

May 5, 2011

I have a script that is supposed to run after a job is sent to a printer that prints a text file to disk. It is supposed to turn that text file in to a PDF. How I do this is my making a fifo /dev device that cats the print job to lpr and then runs my script. The script works expect for 1 thing. I have to use dos2unix to remove some extra characters that shouldn't be in there. I've also tried used sed and that didn't work either.

I should say they both work from the command line, just not when used in the fifo/dev. I know there are weird things that can happen when not running a script from the command line, and maybe I'm doing this all wrong. Part of my script works fine, but dos2unix doesn't work in my script. Sed also doesn't work in my script. But a2ps works and so does ps2pdf.

View 8 Replies


ADVERTISEMENT

Ubuntu :: Sort The Output To A Text File So That It Prints To The Text File At 1 Process Per Line?

Feb 6, 2011

im trying to output a list of running processes via a shell script. At the moment i got this which outputs the processes to a text file called out.

echo $(ps aux) >>out

The problem is though, the processes are all just one big block of text which makes it hard to read. Does anyone know how to sort the output to a text file so that it prints to the text file at 1 process per line? I know its probably simple but im very new to linux.

View 5 Replies View Related

Slackware :: Not Getting Proper Printing In 13.37 - Prints Out Text Of Postscript

May 22, 2011

I have Brother HL2250N. This worked out of the box with 13.0 using the Brother drivers. I also have a Brother MFC-7820N which works fine in 13.0 and 13.37. In 13.37 the testpage from CUPS prints fine. However when I try to print anything from kate or libreoffice I just get pages and pages of text starting with

[code]...

I assume this the post script file that is printing out. How do I get this to print properly?

View 3 Replies View Related

Debian Hardware :: Mc4695MF - Test Page Prints Fine But App Prints Blank Pages

May 19, 2014

I'm struggling on installing a KONICA-MINOLTA printer magicolor 4695MF printing properly with Linux Mint Debian Edition (up to date). The test page works fine...

KONICA-MINOLTA delivers 2 PPDs: one for standard printing and one for OpenOffice printing (available on the KONICA-MINOLTA support site).

Leaving a side the one for OpenOffice which is poor in using the capabilities of the printer, I concentrate only on the global one (M4695PX.ppd).

It's much more difficult for other applications, starting with EVINCE: some PDF files are printed properly (i.e. those generated in OpenOffice by the CUPS PDF printer), others come out as one only blank page, regardless to the original length of the document.

So documents received from 3rd party may be "printable" or not. And trust Murphy, the most critical aren't printed...

Attached, the troubleshooting file generated by [system-config-printer] => [URL] ...

View 0 Replies View Related

General :: Disk Based Text Editor To Edit File Larger Than Memory?

Aug 2, 2010

I am using Ubuntu and looking for a good editor to edit a file that is > 4GB. I just need to put content at the end and beginning of the file. I suppose I could use something like

cat "text to add" >> huge_file

To append to the file. Is that the route to go? What about prepending? In general, what is the best route if I wanted to edit somewhere in the middle?

I've tried VIM and it fails miserably. I assume emacs and nano would be even worse. What else is there? I assume to accomplish what I am looking for, the editor would have to be specifically designed for this by not keeping the entirety of the file's contents in memory.

View 5 Replies View Related

OpenSUSE Hardware :: Printing System Continuously Prints Same File?

Apr 1, 2010

I made a BIG mistake and tried to print a PDF document from Evince 2.28.2. Evince sends a garbage filled print job to the queue that results in nothing but garbage being printed. I noted the problem an tried to kill the print job but could not because it does not show up in the print queue. It appears that the printer sent an error back to the print system and the print system now continues to print the job forever - that is, anytime openSUSE is running, even after reboots.

Note that printing the test page works and that the printer also works fine with gedit and OpenOffice.

If I go to Control Center -> Printing then right click on the icon for the printer and click View Print Queue, the print queue is empty.

In YaST Control Center -> Printer -> Policies the "Specify error policy" is set to "abort and delete the job and proceed with the next job." The "Apply this error policy to all local printer configurations" checkbox was checked when this policy was set. If this is what should have ultimately killed the job it did not work.

how to stop the print system from trying to print this garbaged print job. It has been trying to print the same garbaged print job for the last five days!

View 7 Replies View Related

General :: Bash - Show Prints And At The Same Time Redirect It To A File?

Jul 12, 2010

I have this script in the past for csh: Code: ./a.out |& tee prints.txt which will redirect all printfs in the C program to the prints.txt file and at the same time show them in the console. How do you do this in bash? I have seen this, [URL] but it does not work for my bash and sh shells. It says:

Code: -bash: syntax error near unexpected token `&' and
Code: -sh: syntax error: unexpected "&"

View 2 Replies View Related

Programming :: Remove Lines In A Text File Based On Another Text File?

Jan 28, 2009

I have a text file called file1.txt containing many lines eg.

line1
line2
line3
line4
line5
line6

Then i have another text file called file2.txt contains

3
5
6

Is there a command to remove the lines in file1.txt based on the keywords in file2.txt? note: It should remove line3,line5,line6 based on 3,5,6

View 10 Replies View Related

Fedora :: F14 Gnome Text/plain Versus Text/html File Type

Apr 2, 2011

I put a text file on my desktop and added a couple lines of text with gedit. File type shows text/plain. Double-click opens the file in gedit which is what I want. I'm using the file to temporarily hold some snips of code that I copy from file to file, but when I copy some html into the file and save it, now file properties show it's text/html and a double-click opens the file in firefox, which isn't what I want. Is there some way to keep the file type from changing itself?

View 6 Replies View Related

General :: Replace Text In One File With Text From Another File Using Sed?

Apr 28, 2010

How could I replace text in one file with text from another file using sed?

The text in each of the files would be surrounded by a starting and ending delimiter or a starting tag, say like /* */ so to easily find them.

View 8 Replies View Related

Software :: Use Sed To Include A Text File In The Beginning Of Other Text Files Inside A Folder And Its Subfolders?

Jun 1, 2010

Can I use sed to include a text file in the beginning of other text files inside a folder and its subfolders? So it should be recursive.

View 4 Replies View Related

Programming :: Adding Lines Of Text To Beginning Of Text File

Jan 19, 2009

I need to insert 3-4 lines of text to the beginning of a text file. The file is a largish MYSQL dump, the result of a backup shell script. This shell script should insert the required text.I've wrestled with sed, but lost.

View 2 Replies View Related

Programming :: Delete Line Of Text From Text File Via Shell?

Jan 13, 2010

I have to delete a certain line of text from the a textfile via ubuntu's shell scripting.I have done research, and it seems that most people advocate the usage of sed /d option. sed makes does not edit the text file. Hence, most options I discovered involved the use of a temporary variable/textfile and then overwriting the old file with the temporary new file. Is there anyway whereby I can bypass the use of temporary storage containers? I hope there is any magical combination of commands to edit the file directly.

View 3 Replies View Related

Programming :: Exporting Glade Text View To Text File?

Jan 8, 2011

I want to display something in my text view widget in glade using c code. that's all right.
now I need to attach a save button beneath the text view.so that on click the text view content should save as a txt file..

View 8 Replies View Related

Programming :: Formatting Fields And Text Being Displayed From Text File?

Feb 9, 2011

I want to display the contents of a particular log file (simple text file, I mean in Linux). But there is a problem: The contents need to be organized in a fixed format. Have a look at this log file:

sampleLog.txt

Code:

User Name: XYZ
Reported Problems Description: Blah! Blah! Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah!

[code]....

So, while displaying the contents of above file on a web page, I want to format the field names found in the log file: User Name:, Reported Problems Description:, and Remarks:. These fields may contain a variable length of text and no specific line number is assumed for them to appear on.

The desired output should look like this:

User Name: XYZ
Reported Problems Description: Blah! Blah! Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah!

[code]....

Well, what I am trying to do may sound wierd to some of you. The filed "Reported Problems Description:" can possible contain text which embeds colon (.

View 15 Replies View Related

Ubuntu :: Add / Remove Bits Of Text From A Text File

Dec 6, 2010

I am looking for a way to keep a log and make if then statements if a line exitsts in the log. I also am looking for a way to make a simple loop, like goto line number, and I also am wondering how to add/remove bits of text from a text file (plugins line in server.properties)

View 5 Replies View Related

Programming :: Add Text Before Line Number In Text File?

May 3, 2010

a sed command to add a text before line number in text file? I have text file with 500 lines, and i want to add 3 more lines with text after line 300, OR before line 302, isn't no problem.

View 16 Replies View Related

Ubuntu :: Very SLOW File Copy Speed (disk To Disk)

Mar 27, 2011

i have amd athlon x2 3gb RAM ddr2 two hdd one 80gb other 1tb in this computer i got only ubuntu all disk in EXT4.i want to copy 10gb many file of 700mb or 1gb ( many linux ISO )the transfer is 1mb/s this is SOOO SLOW.i did a touch /forcefsck just in case but nothing happen it is still slow!!what might be the problem ??

View 1 Replies View Related

Fedora Security :: Pointers To Text Documents On Disk?

Jan 22, 2010

how RAR archives work. Suppose I have a .rar archive of text documents (for the sake of argument, containing personal information). I am able to run 'shred *.rar' in that directory from the terminal. What happens here? My assumption is that the contents of the .rar file (pointers to the text documents on the disk?) are 'shredded' (overwritten n times), but the text documents themselves are still on the disk intact.

View 4 Replies View Related

Server :: Scp Truncate Text File Busy - Copying File Is Not A Running Binary?

Jun 14, 2010

I am having problems with scp during a backup operationI added a ps -ef before and after the scp operation used during the backup.The backup is a script to backup a Zimbra ServerI am including the code segment that I am having problems

Code:
# DRCP Section. To scp newly created archives to a remote system
if [ "$DRCP" = "yes" ]

[code]...

View 3 Replies View Related

Programming :: Script To Copy Paste Text From One File To Another (overwriting Part Of The File)?

Apr 19, 2011

I have a .txt-file with ~50.000 lines of numbers, generated by a mathematics program. From this file, I need line ~ 1.100 to line ~16.000 (these lines are always the same btw, this may make the solution easier, dunno) to be copy/pasted to another file, where the lines ~500 to ~15.000 (also, every time the same) should be overwritten by the aforementioned lines...I haven't found or come up with anything that works yet, mostly I find solutions to copy everything from one file to another but I can't find something to specifically overwrite a part of a file with part of another.

View 4 Replies View Related

Red Hat / Fedora :: Convert Plain Text File To Html File Without Using Perl?

Jun 9, 2010

I am looking for some source package which will convert plain text file to html file without using perl.

I mainly need to do this on an ARM platform, so if I get sources I can cross compile it.

View 5 Replies View Related

General :: Convert An HTML Email Saved As A Text File To A PDF File From The Command Line?

Aug 23, 2011

I need to be able to convert HTML email messages saved as text files (.eml or .msg) to PDF documents, one PDF per email, retaining formatting and images.

Are there any Linux tools that will allow me to do this from the command line (so it can be scripted)?

View 1 Replies View Related

Software :: Check The Contents Of A Text File For A Specific String And Remove It From The File From The Command Prompt?

Oct 14, 2010

I want to be able to check the contents of a text file for a specific string and remove it from the file from the command prompt. I would basically be searching through a number of files and if a specific string is found I would like it removed automatically. pretty much a find and replace, were the replace is nothing. any one got any ideas on how you would do this. I already have the search part sorted just need to be able to remove the string I don't want from the multiple files.

View 4 Replies View Related

General :: How To Verify If The File Is Binary Or Text Without To Open The File

Sep 7, 2010

how to verify if the file is binary or text without to open the file

View 2 Replies View Related

Red Hat / Fedora :: Edit A Text File To Delete All Commas In The File?

Jan 4, 2011

i want to find a command line way to edit a text file to delete all commas in the file. i do not want to replace them w/ anything.

View 2 Replies View Related

General :: Change Password Using A Script File And Text File?

Jun 26, 2011

This is for educational purpose. In fact it is my lab tutorial for a subject.I want to capture the users password when he changes his password. Both new and old.This is the script i have come up with:

Code:
#!/bin/bash
echo "Changing password for user $USER."

[code]...

View 5 Replies View Related

General :: Convert A Html File Into A Text File?

Mar 8, 2010

i'm trying to convert a html file into a text file when i simply run "html2text <filename>" the output displayed is the way we want but when i redirect the same using "-o" or ">>" the file is having extra characters in it. i even tried -ascii,but no much use.

View 4 Replies View Related

General :: Copy Some Text In One File And Paste It To Another File?

Sep 19, 2009

favor and let me know how can I copy some text in one file and paste it to another file ,when both of the files are being opened by vi text editor ?

View 7 Replies View Related

Programming :: Create A Duplicate File Of A Text File In PHP?

Nov 11, 2010

What I plan to do is, create a duplicate file of a text file, and then append some text into the new text file.

View 1 Replies View Related







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