Sponsored Content
Top Forums Shell Programming and Scripting Script to open files and write into new one Post 302913408 by malajedala on Saturday 16th of August 2014 08:45:29 AM
Old 08-16-2014
Yes but it is important to me, that the generated file has an ending, like .txt

And if I write like you proposed, so:

Code:
>$1.txt

and then try to concatenate with whatever, cat or echo,
Code:
cat $2 >> $1.txt

It is not concatenating :S, also removed the .txt and wrote

Code:
cat $2 >> $1

but still nothing :S
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Performing an open/read, open/write

I'm trying to do two different things (converting an OpenVms .com to a ksh shell script): 1) open/read/err= 2) open/write/err= Any help? I've found some things, but can't seem to find the correct way. (1 Reply)
Discussion started by: prosserj
1 Replies

2. Shell Programming and Scripting

Script with read/write Files

Hello, I am a Newbie in ksh Unix Script. So I must write a ksh/sh script who read character at a position in a File. So also it must read all the lines who belongs at these characters , then write these lines in a another File. Can you help me , or give little councils to advance with my... (5 Replies)
Discussion started by: steiner
5 Replies

3. Shell Programming and Scripting

write a script to compare two files

Hi all, i am new to unix,i have never worked on scripting and all,i am learning now and i have to write a script to compare two files. The requirement is like : in the first file i am searching for a word and after i get that word i have to select everything from the rest of the file and redirect... (34 Replies)
Discussion started by: usha rao
34 Replies

4. Shell Programming and Scripting

Write a new file from 2 files as input to the script

Hi- I am hoping someone can give me some pointers to get me started. I have a file which contains some dn's .e.g file 1 cn=bob,cn=user,dc=com cn=kev,cn=user,dc=com cn=john,cn=user,dc=com I have a second file e.g. file.template which looks something like :- dn: <dn> objectclass:... (5 Replies)
Discussion started by: sniper57
5 Replies

5. Shell Programming and Scripting

write script for more then 600 files

Hi, i have 600 or more file on my server and from this 600 files i want to make one file. i have written this script SPATH=/etlstg/DAT TPATH=/etlstg/DAT/DAT_PROCESSED FILE_DATE=`TZ=CST+24 date +20%y%m%d` a1=0 while do a2=0 while do a3=0 while ... (1 Reply)
Discussion started by: prasson_ibm
1 Replies

6. UNIX for Dummies Questions & Answers

Not sure how to write a script to delete certain files?

I'm a total *nix newb so I really could use some help! :o I plan on running a cron job on my server that deletes some files and then backs up and emails the website for archival purposes. Before I get in too deep I'd like to remove some unnecessary files that phpThumb creates. I'm not sure... (4 Replies)
Discussion started by: Sinistral
4 Replies

7. Solaris

Find all "regular" files open for write on solaris?

How do I find all "regular" files on solaris(8) that are open for write ( +read as well). I tried using pfiles, and lsof commands, but not sure how to get exactly what I wanted. ps -e | awk '{ print $1 }' | xargs -i pfiles {} 2>/dev/null (10 Replies)
Discussion started by: kchinnam
10 Replies

8. Shell Programming and Scripting

Perl - work with open files or write to @lists first?

I am dealing will many thousand fairy small files. I need to search them for various matches and depending on what I find, may need to search some files again for additional matches. Generally speaking, is it better to write a txt file to an @array/@list and then work with it (multiple... (1 Reply)
Discussion started by: OldGaf
1 Replies

9. Shell Programming and Scripting

Using programs to open files from within the script?

I am suppose to make a program that cuts the extension off of a file. It uses that .ext to decide which program needs to be used to open the file. This only finds the name of the program from a list of programs I made. My problem is when it has the name of the program it needs to use, how can I... (2 Replies)
Discussion started by: dordrix
2 Replies

10. Shell Programming and Scripting

Bash script reg-exp , replace , open and write

Hi All I am a new in scripting language and I would like help for you guys I would like to create a file named constant.h and search into all files *.m in specific directory for a reg-exp @"LBL_]+" exp: @"LBL_75847" , and write those matchs to constant.h if there are not written (no... (15 Replies)
Discussion started by: molwiko
15 Replies
Net::Sieve::Script(3pm) 				User Contributed Perl Documentation				   Net::Sieve::Script(3pm)

NAME
Net::Sieve::Script - Parse and write sieve scripts SYNOPSIS
use Net::Sieve::Script; my $test_script = 'require "fileinto"; # Place all these in the "Test" folder if header :contains "Subject" "[Test]" { fileinto "Test"; }'; my $script = Net::Sieve::Script->new ($test_script); print "OK" if ( $script->parsing_ok ) ; print $script->write_script; or my $script = Net::Sieve::Script->new(); my $cond = Net::Sieve::Script::Condition->new('header'); $cond->match_type(':contains'); $cond->header_list('"Subject"'); $cond->key_list('"Re: Test2"'); my $actions = 'fileinto "INBOX.test"; stop;'; my $rule = Net::Sieve::Script::Rule->new(); $rule->add_condition($cond); $rule->add_action($actions); $script->add_rule($rule); print $script->write_script; DESCRIPTION
Manage sieve script Read and parse file script, make Net::Sieve::Script::Rule, Net::Sieve::Script::Action, Net::Sieve::Script::Condition objects Write sieve script Support RFC 5228 - sieve base RFC 5231 - relationnal RFC 5230 - vacation Draft regex missing 5229 variables 5232 imapflags 5233 subaddress 5235 spamtest notify draft CONSTRUCTOR
new Argument : optional text script Purpose : if param, put script in raw, parse script Return : main Script object Accessors : ->raw() : read or set original text script ->require() : require part of script ->rules() : array of rules ->max_priority() : last rule id METHODS
parsing_ok return 1 on raw parsing success write_script Purpose : write full script, require and rules parts Return : set current require, return rules ordered by priority in text format equals $object->equals($test_object): return 1 if $object and $test_object are equals read_rules $script->read_rules() : read rules from raw $script->read_rules($some_text) : parse text rules use of read_rules set $script->rules() Return 1 on success find_rule Return Net::Sieve::Script::Rule pointer find by priority Return 0 on error, 1 on not find swap_rules Swap priorities, now don't take care of if/else/elsif Return 1 on success, 0 on error reorder_rules Reorder rules with a list of number, start with 1, and with blanck separator. Usefull for ajax sort functions. Thank you jeanne for your help in brain storming. Return 1 on success, 0 on error delete_rule Delete rule and change priority, delete rule take care for 'if' test if deleted is 'if' delete next if next is 'else' change next in 'if' next is 'elsif' Return : 1 on success, 0 on error add_rule Purpose : add a rule in end of script Return : priority on success, 0 on error Argument : Net::Sieve::Script::Rule object BUGS
Rewrite a hand made script will lose comments. Verify parsing success with parsing_ok method before write a new script. SUPPORT
Please report any bugs or feature requests to "bug-net-sieve-script at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-Sieve-Script>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. AUTHOR
Yves Agostini - Univ Metz - <agostini@univ-metz.fr> <http://www.crium.univ-metz.fr> COPYRIGHT
Copyright 2008 Yves Agostini - <agostini@univ-metz.fr> This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. SEE ALSO
Net::Sieve perl v5.10.0 2008-09-15 Net::Sieve::Script(3pm)
All times are GMT -4. The time now is 06:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy