I am trying to find out how to replace a folder that is located in every hosting account on the server I think this is possoble with a bash command of some sort?
The contents of this folder get updated from time to time and its getting to be a real pain doing it manually is there a way to do this via shell or some other method the folder in question is located inside the public_html folder of every account in the server.
Sounds like you should find a different solution, longer term. What if users have customized some parts of the folder's contents?
Do you intend to keep a backup, or just replace whatever is there? What about permissions?
There is no single bash command which will do this, but a simple script would likely suffice.
Assuming all accounts exist under /home, something like
Assuming you have the master copy in /path/to/master, this will copy all files from that folder to each user's public_html/foldername, creating backup files if any files would be overwritten. (Your local implementation of cp might not have the --backup option -- you want to look into that first.)
Then it uses a couple of simple substitutions to extract the user name from the path, and changes the ownership of all files in the destination folder so they belong to the user.
This is pretty brute force; perhaps you want to loop over each individual file and decide whether or not you even need to replace what's possibly already there. Then you could also preserve the user's customization if the user has removed one of these files.
with in my files i have the data like this, starting with a pipe and ending the line with a pipe.
all i want is to replace the first and last pipe , remove those
trying to use following sed command, but it is only showing on the screen the entire data of the file as if it removed, but when i... (4 Replies)
I want to host a website in India, after all my research I have found MilesWeb.com, I am planning to go for their shared plan http://www.milesweb.com/cpanel-hosting.php I have test their contact options and response time, they are really available 24/7. I have checked few other providers, they... (1 Reply)
I have a script that will output folders that all end with "x.deb".
I want a shell script snippet that removes the "x.deb" from all those folders.
Thanks in advance. (27 Replies)
I want to scan through all the files in the folder and replace all instances of $file_X within the file with the variable $X defined in my bash script on my debian 6.0 install.
For example, if the file contains $file_dep I want it to be replaced with the value of the variable $dep defined in my... (1 Reply)
Hi all,
I have a directory structure like "folder1/folder2/website_name/folder3/folder4/file.php."
I need to write a script which will enter into file.php and replace a particular string of characters with "website_name" folder name.
In folder2,there are many such website's folders kept.So... (4 Replies)
Hi guys,
I´m trying to replace the 2 last folders name in a list of directories with a new string, but I´m don´t know which regex to apply.
Directories list:
C/my user/documents/games & music
C/my user/documents/photos 09-24-2008
C/my user/settings/config ?1_2
* The last folder may have... (11 Replies)
Hi all
I hope I am posting in the right section. If not please excuse me and redirect me to the right section.
Here is my problem:
I am using a shared hosting plan at Godady. I have shell access and of course my own folder.
I would like to be able to install programs in my own folder... (4 Replies)
hi all,
I copied set of files from a linux machine to an aix machine but in binary mode copy , ASCII mode copy both leed to control M charecters in most of the files.
Any shell script/C script to remove control M charecters in all files in a given directory.
Pls reply if you are aware... (10 Replies)
i need to change string in all files in current folder and all subfolders. i wrote the following script. It works good except it dont delete temp file from subfolders.
for z in `find . -type f -name "*.html" -o -name "*.htm"`; do
sed -e 's@abc@xyz@g' $z>temp;
mv temp $z;
done
any idea?... (1 Reply)