Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8020107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:35:39+00:00 2026-06-04T21:35:39+00:00

How can I append the following code to the end of numerous php files

  • 0

How can I append the following code to the end of numerous php files in a directory and its sub directory:

</div>
<div id="preloader" style="display:none;position: absolute;top: 90px;margin-left: 265px;">
<img src="ajax-loader.gif"/>
</div>

I have tried with:

echo "my text" >> *.php

But the terminal displays the error:

bash : *.php: ambiguous redirect
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T21:35:40+00:00Added an answer on June 4, 2026 at 9:35 pm

    You don’t specify the shell, you could try the foreach command. Under tcsh (and I’m sure a very similar version is available for bash) you can say something like interactively:

    foreach i (*.php)
    foreach> echo "my text" >> $i
    foreach> end
    

    $i will take on the name of each file each time through the loop.

    As always, when doing operations on a large number of files, it’s probably a good idea to test them in a small directory with sample files to make sure it works as expected.

    Oops .. bash in error message (I’ll tag your question with it). The equivalent loop would be

    for i in *.php
    do 
       echo "my text" >> $i
    done
    

    If you want to cover multiple directories below the one where you are you can specify

    */*.php
    

    rather than *.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the following code to append a hashtag to the end of a
I have the following code: $(#samplediv).html(<div>); $(#samplediv).append(<b>Test text</b>); $(#samplediv).append(</div>); I require the following output:
for the following code a =func() if a != None: b.append(a) a can be
I can't seem to figure this out : $(.task:last).append( $(<div/>, {class: 'clear'}) + $(<div/>,
I have the following C# code to produce a small PHP file. The reason
What are the parameters i can append to a standard java -jar command? For
Is there a command that can append one array of char onto another? Something
If I have some R list mylist , you can append an item obj
Can I append to a list in a dictionary? test = {'food' : 'apple'}
How can I append this <% =i %> variable onto this. <asp:DropDownList ID=AdTitle runat=server>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.