Programming :: Adding Some Code To Like 50 PHP Files
Jan 15, 2010
I need to basically add some code to like 50 php files. It's basically a script that I want to add near the end of these 50 php files. I figured I could use sed to replace </body> with the code. However the code, is very long and has a bunch of newlines obviously. How would I be able to do this?
sed -e 's/<//body>/(all the text)/' *.php
Since it has newlines, I don't know how to paste it in cause it would take me to a '>' prompt without allowing me to complete the sed command. I want to insert this code.
Code:
<br><br>
<center>
<form action="test.php" method=post>
<textarea name="comments" cols=40 rows=6>
View 3 Replies
ADVERTISEMENT
Feb 26, 2009
Where do i found source code of c library files in ubuntu.
View 2 Replies
View Related
Jul 25, 2011
The rpm command to get all the list of all installed file location after rpm installation is rpm -ql <rpm file-name>
View 7 Replies
View Related
Apr 12, 2010
I'm writing a bash shell script that among various other things will traverse through a directory with hundreds of files and rename those who match a pattern found in a config file. It's expected that only about one in ten files will actually match, and those who don't, will simply just be ignored for this purpose.
This should for instance cause the file "dBase program file December 1987.prg" to be renamed "Clipper source code December 1987.prg", and conversely "C++ source August 1996.cpp" to be renamed "C source code August 1996.cpp" etc.A sample file such as "Random Data File.dat" should not be renamed here since it's not mentioned in the config file..What is the quickest, most elegant way to do this in bash?I am thinking of using bash's built-in regex matching combined with the /bin/rename utility, but don't quite know how to get started to catch this..I guess there are plenty ways of doing this in perl and elsewhere as well, but since this has to integrate into a pre-existing bash script, that's what I'm looking for.Anyone out there with a spare moment to offer a hint in the right direction?
View 14 Replies
View Related
Mar 30, 2011
I need to rewrite the selenium java code into its equivalent php code.
View 5 Replies
View Related
Jul 13, 2010
I wrote some bash code to prevent redundantly including files, like php's "include_once". I've simplified it here so don't worry that it appears not to do anything:
Code: alias .='Include'
alias source='Include'
export __INC__functions=1
[code]....
View 1 Replies
View Related
Jun 6, 2011
I am working on a project with a lot of vector math and I'd like to find a way to speed it up.eading about SSE, but I've found no explanation on how to actually use it in code (was looking for some kind of hello-world example, complete with compilation instructions).Does the gcc compiler automatically make use of SSE, if you add the -sse(2,3) option on the command line? Or are their specific functions/libraries you need to call?
View 12 Replies
View Related
Feb 25, 2010
This is not working for me, I cant run my c-code files.
This is how I do:
But I cant get it to run!
I have gcc installed. Whats wrong?
I only get, no such file or...
Do I have so save the file somewhere special?
View 1 Replies
View Related
Mar 1, 2010
I have a problem on a program,the problem take a very long time when i try to add two big arrays element by elementI know that matlab make adding vectors more faster than adding element by element but I don't know how!!!do any body knew how matlab make vectors operations more faster than element by element???I want to make my calculation more faster because the program is very big
View 8 Replies
View Related
Jan 26, 2010
I am new to linux. I want to use a header file asm/msr.h. But the /usr/include does not contain the header file that I want. Can I just copy the whole asm directory into the directory /usr/include, and overwrite the old one?
View 2 Replies
View Related
May 23, 2011
Is there, by chance, a fancy name to describe code that must be in a program but will never be executed? In one of my (Haskell) programs, I have some error-handling code that must be in the program to keep the compiler happy (due to the type checking). However I know that, due to the logical structure of the program, it is impossible for the code to be evaluated. I am curious if there is a technical name given to code that must exist but cannot be executed.
View 6 Replies
View Related
Jan 14, 2011
I went to compile some "oldish" glx code. The code compiles great but when I go to run it I get a crash. With X Error of failed request: BadMatch (in .....running ddd causes my whole system to lock up when I call the glx function XOpenDisplay. After a few attempts I thought I'd download a demo from the net, I choose nehe opengl tutorial 2, I compiled and ran but even on a net tutorial I get the same error
./lesson02
XF86VidModeExtension-Version 2.2
Got Doublebuffered Visual!
[code]....
View 1 Replies
View Related
Jul 20, 2011
I have the following code:
Code:
#!/bin/bash
function dx {
[Code].....
So essentially, it finds dx files, sorts them by numbers at the beginning, then performs the dx function I made (loops over all of the #-protein.dx and #-water.dx files).
It works fine when I'm running it on Ubuntu 11.04. However, when I try to run it on OSX, I get the following error:
Code:
mh320m01:DA_R02 janickij$ ./MOD_Loop_Tuber_Script.sh
find: illegal option -- t
find: illegal option -- y
[Code]....
View 9 Replies
View Related
Jan 5, 2010
I work as a linux sysadmin, and are now and then developing scripts that might be of use for others. I'd like to be able to share these, and for less trivial projects maybe create a central repository or something that others may upload updates/patches to etc.
View 10 Replies
View Related
Apr 10, 2010
I have a little test program consisting of a NASM source file and a C source file.How do I turn them into a single program?
Code:
section .data
msg db 'Hello, World!', 10
[code]....
View 14 Replies
View Related
Feb 23, 2011
whichever source code I go through I find these three lines of code written what do they actually mean and what is their function?
[code]...
View 6 Replies
View Related
Jun 6, 2010
Im trying to create the following script...I want to create an interactive script that prompts the user for the following:
user name
user home directory
user login shell
user comment
the script then needs to read those variables that are entered by the user and actually create the user account. and of course, would like the script to display what user account was just created so that i know in fact the script worked successful.
View 2 Replies
View Related
Jun 9, 2011
i am searching for a table that gives info about the result of operations (+ , - , * , /) on data types
i mean if we * int by another int, the result should be assign in long so no overflow happens.
something like that.
like what will be the result of mult unsigned int by signed it , is there tables for such operations.
View 6 Replies
View Related
Apr 2, 2009
I have made the installation of Qt4 in my Fedora/MacBookPro. It also got a first compiling and running a simple program. The point is that for the compiler to run I need to point out every time where the bin is located, as that:
$ /home/threader/kinetic/bin/qmake -project
I have tried the following, but it still doesn't work:
# script
#-----------------------------------------------------------#
# /etc/bashrc or /home/threader/.bash_profile
# config to Qt compiler
[code]....
View 5 Replies
View Related
Apr 10, 2010
I use following script:-
Code:
#!/bin/sh
# cd Linbread
TODAY=`date +"%m%d"`
DATA=`grep $TODAY linbread.dat`
[code]....
sound file .wav and background .gif are available. Please advise what shall I add to the script to do the job as expected.
View 1 Replies
View Related
Jan 30, 2010
So I decided to take my first steps into programming with C + gtk. So far I have doneI loaded eclipse and ensured I had the cdt package Created a new C/C++ project called "play" Added a new source file called "Playfullsrc.c" Added the following to paths and symbols (output of the command: pkg-config --cflags gtk+-2.0)
Code:
/usr/include/gtk-2.0
/usr/lib/gtk-2.0/include
/usr/include/atk-1.0
/usr/include/cairo
/usr/include/pango-1.0
/usr/include/pixman-1
/usr/include/freetype2
[Code]....
added "/usr/lib/libgtk-x11-2.0.so" to GCC C Linker Libaries (I have cheacked and this file exists) When I build the project I get the error message "cannot find -l/usr/lib/libgtk-x11-2.0.soplayline 0C/C++ Problem" I have been following this tutorial: [URL]
View 2 Replies
View Related
Dec 18, 2010
I have a file for plotting contour graph in gnuplot.The data in the fine as below:Quote:
1 1 3
1 2 7
1 3 6
[code]....
View 9 Replies
View Related
Sep 16, 2010
I have a debian lenny machine that I am trying to add mod_perl to and use apache asp on. I have had a range of failures on it. Is ther a way I can build apache2 with mod_perl in it? Instead of separate. Apache2 is built with some modules built in by default, how can I make mod_perl one of them?
View 1 Replies
View Related
Jun 23, 2010
I just noticed that my hard drive is filling up with unnecessary files. what is the command to clean it up?
I've had to do this in Mandriva a while ago on my other pc. I'm running opensuse 11.2 KDE 64 bit
View 5 Replies
View Related
Apr 16, 2010
You will need "cuetag" for this which is part of the "cuetools" but since you already installed it (see previous seps), all you have to do is open the terminal, navigate to the folder where you just splitted some APE or FLAC files and type this:
Code:
cuetag *.cue split-track*.flac ;
(if you didn't change the file's name from split-trackNN.flac). All the split-track*.flac files will have tags in just a few seconds.so i did exactly what i was suppose to do but for some reason is still could not add the tags to my FLAC files..
Code:
kon@kon-laptop:~$ cd ~/Desktop
kon@kon-laptop:~/Desktop$ cd *ora*
kon@kon-laptop:~/Desktop/sDvorak $ cd *CD1*
[code]....
View 2 Replies
View Related
Jul 9, 2010
would anyone know how to solve this problem im having.I copied some files from a normal cd then tried to burn them to another cd the same size but it says the new cd is to small by 24mb which i could`nt workout then, how they fitted on the original.Have the original files been compressed some how?If so how would i do the same to fit them on the new cd?
View 1 Replies
View Related
Sep 26, 2010
how do i add all of my itunes files i have saved on windows to my amarok library. i am running linux and windows on same machine, when i boot up it asks me which OS to start. i tried playing a .m4a song in amarok, but it wouldn't play
View 1 Replies
View Related
Jan 11, 2011
Whenever I download a file using Firefox or Google Chrome and it has a ' character on it's filename, the file is renamed and a is added before the '. It's really annoying and I'd like to know how can I solve this issue.
View 9 Replies
View Related
Jan 14, 2010
I need to modify the ISO file by adding few files so that after all installation done I can run a sh script to do some thing on the box. How to do that?
View 4 Replies
View Related
Feb 16, 2011
I want to write a c program with some shell scripts.Now For a simple C program. I am Setting a variable called val2 in bash, now I want to use bash variable val2 in C code. How do I do that?The above doesn't work (coz its spawning a different memory space and when shell script ends the variable dies with it as per my research but how do I keep them in same memory space)Also Is there any Good reference where they teach how to integrate C and Bash Together?
View 5 Replies
View Related