Jump to content

saving to all files with sed [solved]


Recommended Posts

I have a shell script here that I'm trying to use, pretty self-explanitory, I just need help getting sed to correctly write to the files.

Here's what I have:

 

echo "Input directory:"
read dir
echo "Input original string:"
read str1
echo "Input final string:"
read str2
cd $dir
sed s/$str1/$str2/ * > *

The problem, of course, is that sed then writes it to a file called '*'. How do I make it write to the file it pulled it from?

Edited by Urza9814
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...