Tagged Questions
1
vote
5answers
208 views
Replacing lines in files with file contents
I have several files which contain some PHP includes and I want to substitute them with the file contents. The file looks like
foo
<?php
include("file1.php");
?>
bar
baz
<?php
...
2
votes
2answers
69 views
'tie' [nonexisting] files to programs
Recently, I just had an idea which turned out to be pretty useful under certain circumstances. But first some simple explanation:
In Perl, you have the option to tie variables to some functions ...
2
votes
2answers
131 views
find command for the newest 500 files in a directory tree and also be POSIX compliant
I am looking for a single line shell script or unix command to find the newest 500 files in a directory. Major constraints are it should be POSIX complaint and the directory can have tons of files.
2
votes
4answers
894 views
How to insert the content of a file into another file (if regexp) in shell/perl
File1 Contents:
line1-file1 "1"
line2-file1 "2"
line3-file1 "3"
line4-file1 "4"
File2 Contents:
line1-file2 "25"
line2-file2 "24"
Pointer-file2 "23"
...