06-17-2009
Writing a text to many files
Is there a command in shell-script that I can use that copies a string or writes it to many files? Say I have files a, b and c and I want to copy or write the text "Hallo, I am a newbie!" to all these files? I know I can do echo "Hallo, I am a newbie!" > a but this only copies it to one file. How can I do it to copy to all without repeating this command again and again.
Thanks in advance.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello. I have one file that is a collection of discarded emails. Each email is it's own section with each section beginning with the same header (ie 'Another Email' ). I want to traverse through the file and every time I find the header ('Another Email') I then want to pick out the 'To:' line... (5 Replies)
Discussion started by: scottf33
5 Replies
2. UNIX for Dummies Questions & Answers
Is there a way to tell what files/scripts are writing/wrote to a given directory? (3 Replies)
Discussion started by: hattorihanzo
3 Replies
3. UNIX for Dummies Questions & Answers
Hello,
Our group is just starting to get into UNIX here. We are former REXX users on a VM Mainframe. Can someone point me to the documentation to read a file and write a file in a Unix Shell Script or does this have to be done in another language?
Thank you in advance...
Dave (3 Replies)
Discussion started by: tracydp
3 Replies
4. Shell Programming and Scripting
I need to write value of variable $version at a particular line in a text file.
Line number is determined by another variable &line......I don't know how to do it in shell script ... (2 Replies)
Discussion started by: punitpa
2 Replies
5. Shell Programming and Scripting
Hey Guys,
I was wondering if someone would give me a hand with an issue I'm having, let me explain the situation:
I have a file that is constantly being written to and read from with updated lines:
# cat activity.file
activity1
activity2
activity3
activity4
activity5
This file... (2 Replies)
Discussion started by: bashshadow1979
2 Replies
6. Programming
I am trying to write .pgm images using the O_DIRECT flag in open().
I have a char* buffer which has the image data.
I know that I have to align the buffers and have done that using posix_memalign() yet only a part of the image gets written.
Has someone used O_DIRECT for writing files... (3 Replies)
Discussion started by: anchit87
3 Replies
7. Shell Programming and Scripting
Hi,
I have two text files. Need to create a third text file extracting specific data from first two existing files..
Text File 1: Format contains:
SQL*Loader: Release 10.2.0.1.0 - Production on Wed Aug 4 21:06:34 2010
some text ............so on...and somwhere text like:
Record 1:... (1 Reply)
Discussion started by: shashi143ibm
1 Replies
8. Shell Programming and Scripting
Hello:
I have the following code:
----------------------------------
open (OUTPUT_FILE, ">>/usr/users/rovolis/PREPAID/CC/TCG/PP.$cyear$cmonth$cday.txt")||die "$!";
82 open (OUTPUT_FILE2, ">>/usr/users/rovolis/PREPAID/CC/TCG/PR.$cyear$cmonth$cday.txt")||die "$!";
83 # ... (0 Replies)
Discussion started by: chriss_58
0 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I know the code to write a piece of text to the end of a given text file is
echo $text >> filename.txt
I would like to know how to write a piece of text to a file using shell, but the file name isn't given. I want it to write to whatever text file is currently open. Not to all text files... (2 Replies)
Discussion started by: anirudh215
2 Replies
10. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Write a template main.c file via shell script to make it easier for yourself later.
The issue here isn't writing... (2 Replies)
Discussion started by: george3isme
2 Replies
LEARN ABOUT DEBIAN
catalyst::plugin::i18n
Catalyst::Plugin::I18N(3pm) User Contributed Perl Documentation Catalyst::Plugin::I18N(3pm)
NAME
Catalyst::Plugin::I18N - I18N for Catalyst
SYNOPSIS
use Catalyst 'I18N';
print join ' ', @{ $c->languages };
$c->languages( ['de'] );
print $c->localize('Hello Catalyst');
Use a macro if you're lazy:
[% MACRO l(text, args) BLOCK;
c.localize(text, args);
END; %]
[% l('Hello Catalyst') %]
[% l('Hello [_1]', 'Catalyst') %]
[% l('lalala[_1]lalala[_2]', ['test', 'foo']) %]
[% l('messages.hello.catalyst') %]
DESCRIPTION
Supports mo/po files and Maketext classes under your application's I18N namespace.
# MyApp/I18N/de.po
msgid "Hello Catalyst"
msgstr "Hallo Katalysator"
# MyApp/I18N/i_default.po
msgid "messages.hello.catalyst"
msgstr "Hello Catalyst - fallback translation"
# MyApp/I18N/de.pm
package MyApp::I18N::de;
use base 'MyApp::I18N';
our %Lexicon = ( 'Hello Catalyst' => 'Hallo Katalysator' );
1;
CONFIGURATION
You can override any parameter sent to Locale::Maketext::Simple by specifying a "maketext_options" hashref to the "Plugin::I18N" config
section. For example, the following configuration will override the "Decode" parameter which normally defaults to 1:
__PACKAGE__->config(
'Plugin::I18N' =>
maketext_options => {
Decode => 0
}
);
All languages fallback to MyApp::I18N which is mapped onto the i-default language tag. If you use arbitrary message keys, use i_default.po
to translate into English, otherwise the message key itself is returned.
EXTENDED METHODS
setup
METHODS
languages
Contains languages.
$c->languages(['de_DE']);
print join '', @{ $c->languages };
language
return selected locale in your locales list.
language_tag
return language tag for current locale. The most notable difference from this method in comparison to "language()" is typically that
languages and regions are joined with a dash and not an underscore.
$c->language(); # en_us
$c->language_tag(); # en-us
installed_languages
Returns a hash of { langtag => "descriptive name for language" } based on language files in your application's I18N directory. The
descriptive name is based on I18N::LangTags::List information. If the descriptive name is not available, will be undef.
loc
localize
Localize text.
print $c->localize( 'Welcome to Catalyst, [_1]', 'sri' );
SEE ALSO
Catalyst
AUTHORS
Sebastian Riedel <sri@cpan.org>
Brian Cassidy <bricas@cpan.org>
Christian Hansen <chansen@cpan.org>
COPYRIGHT AND LICENSE
Copyright (c) 2005 - 2009 the Catalyst::Plugin::I18N "AUTHORS" as listed above.
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2010-06-14 Catalyst::Plugin::I18N(3pm)