Sponsored Content
Full Discussion: Apologies from a newbie!
Top Forums UNIX for Dummies Questions & Answers Apologies from a newbie! Post 302336894 by speedfreak on Thursday 23rd of July 2009 04:43:13 AM
Old 07-23-2009
lathavim / pludi, thank you for your super-fast reply!
DukeNuke2 - apologies for not giving correct subject text!

lathavim / pludi - If I was running either of your commands manually it would work perfectly as I would be able to enter the name of the file I want to modify, however, remember my filename changes each month and I want to automate this.

Using either

sed -e '2,1d' file >file.tmp&&mv file.tmp file
or
perl -ni -e 'print if !/^\s*$/;' file.txt

requires me to enter the filename - but like I said, it changes each month and I want to automate the process. I need the script to actually fill in the filename for me. The file will always start with Myfile, and it will be the only file in the directory starting like this.

I had thought of using

ls Myfile* > nameholder

This creates a file called nameholder, within which is the name of the current months file to be modified.

If I could then somehow get the script to read that file and save the value as a parameter I could then use that parameter in the sed or perl command

sed -e '2,1d' $myfile >file.tmp&&mv file.tmp $myfile

Thanks for your excellent suggestions though.

Any thoughts?
 

6 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

apologies to Perderabo

Sorry Perderabo, really was only asking advice on where best to post, and if I should post. Didn't intend for that missive to be posted. (0 Replies)
Discussion started by: keith.m
0 Replies

2. Post Here to Contact Site Administrators and Moderators

apologies

sorry, I recently posted twice, thinking it didn't go through. didn't mean to make you hassle with redundancy. thanks for your good work. (1 Reply)
Discussion started by: protienplant
1 Replies

3. UNIX for Dummies Questions & Answers

UNIX newbie NEWBIE question!

Hello everyone, Just started UNIX today! In our school we use solaris. I just want to know how do I setup Solaris 10 not the GUI one, the one where you have to type the commands like ECHO, ls, pwd, etc... I have windows xp and I also have vmware. I hope I am not missing anything! :p (4 Replies)
Discussion started by: Hanamachi
4 Replies

4. Shell Programming and Scripting

perl newbie . &&..programming newbie (question 2)

Hello everyone, I am having to do a lot of perl scripting these days and I am learning a lot. I have this problem I want to move files from a folder and all its sub folders to one parent folder, they are all .gz files.. there is folder1\folder2\*.gz and there are about 50 folders... (1 Reply)
Discussion started by: xytiz
1 Replies

5. Post Here to Contact Site Administrators and Moderators

Help with deleting post, apologies about the earlier post.

Apologies about the earlier post, i didnt realise, could i delete that post? I apologise again, SynGc (1 Reply)
Discussion started by: SynGc
1 Replies

6. Post Here to Contact Site Administrators and Moderators

Our Apologies for the Down Time This Weekend (Servercraft Migration)

In case you did not notice, our server was not available for about 10 hours this weekend. Our service provider (Servercraft) moved their entire data center from Houston to Dallas, TX. They sent numerous emails to me but because of how I have configured gmail, none of the messages made... (0 Replies)
Discussion started by: Neo
0 Replies
SQL::ReservedWords::Oracle(3pm) 			User Contributed Perl Documentation			   SQL::ReservedWords::Oracle(3pm)

NAME
SQL::ReservedWords::Oracle - Reserved SQL words by Oracle SYNOPSIS
if ( SQL::ReservedWords::Oracle->is_reserved( $word ) ) { print "$word is a reserved Oracle word!"; } DESCRIPTION
Determine if words are reserved by Oracle Database. METHODS
is_reserved( $word ) Returns a boolean indicating if $word is reserved by either Oracle7, Oracle8i, Oracle9i or Oracle10g. is_reserved_by_oracle7( $word ) Returns a boolean indicating if $word is reserved by Oracle7. is_reserved_by_oracle8( $word ) Returns a boolean indicating if $word is reserved by Oracle8i. is_reserved_by_oracle9( $word ) Returns a boolean indicating if $word is reserved by Oracle9i. is_reserved_by_oracle10( $word ) Returns a boolean indicating if $word is reserved by Oracle10g. reserved_by( $word ) Returns a list with Oracle versions that reserves $word. words Returns a list with all reserved words. EXPORTS
Nothing by default. Following subroutines can be exported: is_reserved is_reserved_by_oracle7 is_reserved_by_oracle8 is_reserved_by_oracle9 is_reserved_by_oracle10 reserved_by words SEE ALSO
SQL::ReservedWords <http://www.oracle.com/technology/documentation/> AUTHOR
Christian Hansen "chansen@cpan.org" COPYRIGHT
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.8.8 2008-03-28 SQL::ReservedWords::Oracle(3pm)
All times are GMT -4. The time now is 05:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy