Sponsored Content
Top Forums Shell Programming and Scripting Place 'find' results within TeX command Post 302480335 by HannesBBR on Tuesday 14th of December 2010 02:46:54 PM
Old 12-14-2010
substitute: echo or ex ?

Hi,

In an effort to collect all my .java-files and place them in a LaTeXfile (using the listings environment of latex), i tried to use ex.
So what i have now is:

Code:
find . -name "*\.java" > latex
ex latex <<HERE
%s/\(.*\)/\\lstinputlisting{\1}
wq
HERE

So i try to escape the '\' with another '\' but this doesn't work. So someone suggested me to use echo, which would be alot easier.

So i tried:

Code:
echo \lstinputlisting{$(find . -name "*/.java")}

But this wraps the 'lstinputlisting' around all the results together and not around each result individually.

Anyone has a suggestion ? I'd prefer to use echo, but i can't find how to use it properly to get the right outcome. So just need an echo command to wrap \lstinputlisting{} around every search result.

Last edited by HannesBBR; 12-14-2010 at 04:51 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sending find command results to email

This is probably simple so forgive me... I just want to find all files in a folder created within the last 10 minutes... This is easy: # find /home/folder -cmin -10 If the find command locates any files created in the last ten minutes I want it to send an email alert. I just want to... (3 Replies)
Discussion started by: gardellap
3 Replies

2. Shell Programming and Scripting

edit results of a find command

Hi Purpose is to have a utility command to find and edit files . I tried a function like the following in my .profile file function vifind(){ find . -name $1 -print -exec vi {} \; } Is this correct? is there a better way to do it? I see this behaving a bit strange in case of AIX, and... (6 Replies)
Discussion started by: grep_whoami
6 Replies

3. UNIX for Dummies Questions & Answers

looking for patterns/tex in a .doc file

I'm learning Unix on my mac, and know that the grep command only works in text files. But what if I want to search for text/patters in a doc file, say? (I write my letters in NeoOffice and save them in .doc format). Is there a unix command that can do that? (4 Replies)
Discussion started by: Straitsfan
4 Replies

4. Shell Programming and Scripting

Find a string and place two blank lines

Hi friends, I am looking for a line to find a particular string in my file and once found then replace with 2-3 blank lines before the string Example: aaa 11 bbb 1 2 3 aaa 22 bbb 4 5 6 Output (4 Replies)
Discussion started by: shaliniyadav
4 Replies

5. UNIX for Dummies Questions & Answers

Find command gave unexpected results

Hi, I recently executed a find command that caused unexpected permission changes and we had to do a full system restore. Can someone please explain what this command would do? find /staging/admin/scr * -exec chmod 755 '{}' + It caused file permissions inside / to be modified strangely. ... (1 Reply)
Discussion started by: poornima
1 Replies

6. Shell Programming and Scripting

script to find backshash and place the content in next line

Hi All, I am new to the forum and scripting...Can someone help me with a code.. My input file will be like $cat first aa a\b bb\ccccc\ddd ee*e\fff\ggg output should be aa a\ b bb\ ccccc\ ddd ee*e\ fff\ ggg I tried with cat first | awk '{ gsub( /\\/, "/\\/" );... (5 Replies)
Discussion started by: madhanmo
5 Replies

7. Shell Programming and Scripting

Find regex, place on individual lines and insert blank line before

Hello, I have a file that I want to be able to insert a new line before every instance of a regex. I can get it to do this for each line that contains the regex, but not for each instance. Contents of infile: Test this 1... Test this 2... Test this 3... Test this 4... Test this... (2 Replies)
Discussion started by: deneuve01
2 Replies

8. UNIX for Advanced & Expert Users

Place the results of a CUT command into a variable

I am being passed a file in UNIX, ie: variable.txt I need to extract the first part of the file content, up to the period, content ie: common_dir.second_output cut -d'.' -f1 /content/stores/variable.txt I then need to utilize the results to create a variable ($1), and test on that... (4 Replies)
Discussion started by: talonbow
4 Replies

9. Shell Programming and Scripting

ksh script find command not printing any results

Hello, Hitting a wall on this one. When at the command prompt it works fine: # find /home/testuser -name 'PAINT*canvasON.txt' /home/testuser/PAINT_canvasON.txt # pwd /home/testuser # ls -l PAINT*canvasON.txt -rw-r--r-- 1 root user 23 Feb 07 02:58 PAINT_canvasON.txt... (2 Replies)
Discussion started by: seekryts15
2 Replies

10. Shell Programming and Scripting

Find with rm command gives strange results

I want to remove any files that are older than 2 days from a directory. It deletes those files. Then it comes back with a message it is a directory. What am I doing wrong here? + find /mydir -mtime +2 -exec rm -f '{}' ';' rm: /mydir is a directory (2 Replies)
Discussion started by: jtamminen
2 Replies
LATEXDIFF-VC(1) 					User Contributed Perl Documentation					   LATEXDIFF-VC(1)

NAME
latexdiff-vc - wrapper script that calls latexdiff for different versions of a file under version management (CVS, RCS or SVN) SYNOPSIS
latexdiff-vc [ latexdiff-options ] [ latexdiff-vc-options ] -r [rev1] [-r rev2] file1.tex [ file2.tex ...] or latexdiff-vc [ latexdiff-options ] [ latexdiff-vc-options ][ --postscript | --pdf ] old.tex new.tex DESCRIPTION
latexdiff-vc is a wrapper script that applies latexdiff to a file, or multiple files under version control (CVS or RCS), and optionally runs the sequence of "latex" and "dvips" or "pdflatex" commands necessary to produce pdf or postscript output of the difference tex file(s). It can also be applied to a pair of files to automatise the generation of difference file in postscript or pdf format. OPTIONS
--rcs, --svn, or --cvs Set the version system. If no version system is specified, latexdiff-vc will venture a guess. latexdiff-cvs and latexdiff-rcs are variants of latexdiff-vc which default to the respective versioning system. However, this default can still be overridden using the options above. -r, -r rev or --revision, --revision=rev Choose revision (under RCS, CVS or SVN). One or two -r options can be specified, and the resulting in different behaviour: latexdiff-vc -r file.tex ... compares file.tex with the most recent version checked into RCS. latexdiff-vc -r rev1 file.tex ... compares file.tex with revision rev1. latexdiff-vc -r rev1 -r rev2 file.tex ... compares revisions rev1 and rev2 of file.tex. Multiple files can be specified for all of the above options. All files must have the extension ".tex", though. latexdiff-vc old.tex new.tex compares two files. The name of the difference file is generated automatically and reported to stdout. -d or --dir -d path or --dir=path Rather than appending the string "diff" and optionally the version numbers given to the output-file, this will prepend a directory name "diff" to the original filename, creating the directory and subdirectories should they not exist already. This is particularly useful in order to clone a complete directory hierarchy. Optionally, a pathname path can be specified, which is prepended instead of "diff". --ps or --postscript Generate postscript output from difference file. This will run the sequence "latex; latex; dvips" on the difference file (do not use this option in the rare cases, where three "latex" commands are required if you care about correct referencing). If the difference file contains a "ibliography" tag, run the sequence "latex; bibtex; latex; latex; dvips". --pdf Generate pdf output from difference file using "pdflatex". This will run the sequence "pdflatex; pdflatex" on the difference file, or "pdflatex; bibtex; pdflatex; pdflatex" for files requiring bibtex. --force Overwrite existing diff files without asking for confirmation. Default behaviour is to ask for confirmation before overwriting an existing difference file. --help or -h Show help text --version Show version number All other options are passed on to "latexdiff". SEE ALSO
latexdiff PORTABILITY
latexdiff-vc uses external commands and is therefore limited to Unix-like systems. It also requires the RCS version control system and latex to be installed on the system. Modules from Perl 5.8 or higher are required. AUTHOR
Copyright (C) 2005 Frederik Tilmann This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License Version 2 Contributors: S Utcke, H Bruyninckx perl v5.14.2 2007-09-29 LATEXDIFF-VC(1)
All times are GMT -4. The time now is 08:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy