Sponsored Content
Top Forums Shell Programming and Scripting Newbie - Need help in bash scripting Post 26083 by peter.herlihy on Sunday 11th of August 2002 08:28:48 PM
Old 08-11-2002
FYI.... you shouldn't post homework questions in these forums. Especially not when you haven't made attempts to answer them at all yourself!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Shell Scripting Newbie

I'm relatively new at this scripting game, just need to learn some basic stuff for data handling. My current need is to write a script that loops through a textfile of filenames, and for each file removes the first line and re-writes that file to a new name. In fact I could do with knowing... (1 Reply)
Discussion started by: mattyjim2
1 Replies

2. Shell Programming and Scripting

Scripting Newbie

Seems simple but I am having difficulty with this one: I am trying to write a single command line argument (which will be a path) - the program should print out the owner of the path. I can not get anything I write to run. Please help. (5 Replies)
Discussion started by: Kymmers7
5 Replies

3. Shell Programming and Scripting

scripting newbie needs help

I have written a script that will email a generic user when a device is "offline". I would like to enhance this by having the script lookup a contact's email and automatically add it to the MAIL_LIST. I am trying to lookup and return data based on a field common in two files File 1 ... (0 Replies)
Discussion started by: irishluck66
0 Replies

4. Shell Programming and Scripting

scripting newbie... some help please?

hi all, i am just getting in to bash scripting, so don't be too harsh... i've created this little backup script, and it's just awfull... ugly, doesn't work like I want it to, the works. anyways, i was hoping some of you might help me improve it and learn a little in the process. what i... (13 Replies)
Discussion started by: jmd9qs
13 Replies

5. Shell Programming and Scripting

Shell Scripting NEWBIE - Need Help

Could someone please recommend a very good shell scripting book for me. I would be starting a new job that would require a very good understanding of shell scripting. Please help. (3 Replies)
Discussion started by: ayoka
3 Replies

6. Shell Programming and Scripting

Scripting needed for newbie

Hi, I am newbie in shell scripting I have a file name like simple.txt which comes from Mainframe systems onto windows dir every 15 minutes daily. File name is same. Every 15 minutes it updates. I need to write shell script to check if the file arrived every 15 min or not. If the new file... (4 Replies)
Discussion started by: chinniforu2003
4 Replies

7. Shell Programming and Scripting

Newbie bash scripting help requested

Hi, I'm very new to bash scripting and Linux in general. I'm running Ubuntu Server 10.04 and trying to write a bash script to launch a program. In doing so, I've come across a couple of things that I obviously don't understand. Here is a short script that exemplifies those things: ... (9 Replies)
Discussion started by: Carson Dyle
9 Replies

8. Shell Programming and Scripting

Shell Scripting Newbie

Hi Guys, I want to create a shell script to run multiple jobs in sequence. Explaination - If I were to run each jobs individually I would have gone to folder - "abin"(where my shellscript is place) as follows cd abin abin > runappeng.sh abc001 Now, I have list of programs which are like... (8 Replies)
Discussion started by: chaits84
8 Replies

9. Shell Programming and Scripting

Bash scripting - Newbie

Hi all, I have drill to do and I'll very appreciate your help: Please create a simple CSV file as follow (3 columns and 4 rows): A,B,C A,”B,C”,D “A,B”,C,D o A,B,”C,D” - Please refer to the comma between the quotation marks as a parameter and not as a separator. - Please provide... (3 Replies)
Discussion started by: elior
3 Replies

10. Shell Programming and Scripting

Newbie needs help with some bash scripting

Please bear with me, I'm a beginner but have had some experience and decent knowledge to understand things as I read them and I'm in the process of trying to learn more. I recently inherited a UNIX server which has a bash script which is part of a crontab schedule that needs to be modified (or... (3 Replies)
Discussion started by: Danylko
3 Replies
btool_faq(3)							      btparse							      btool_faq(3)

NAME
btool_faq - Frequently-Asked Questions about btparse and Text::BibTeX DESCRIPTION
This document attempts to address questions that I have been asked several times, and are easy to answer -- but not by perusing the documentation. For various reasons, the answers tend to be thinly distributed across several man pages, making it difficult to figure out what's going on. Hence, this man page will attempt to tie together various strands of thought, providing quick, focused, "How do I do X?" answers as opposed to lengthy descriptions of the capabilities and conventions of the btOOL libraries. PERL LIBRARY
This section covers questions that users of "Text::BibTeX", the Perl component of btOOL, have asked. Why aren't the BibTeX "month" macros defined? Because they're bibliography-specific, and "Text::BibTeX" by default doesn't impose any assumptions about a particular type of database or data-processing domain on your entries. The problem arises when you parse entries from a file, say foo.bib that quite sensibly use the month macros ("jan", "feb", etc.) provided by the BibTeX standard style files: $bibfile = new Text::BibTeX::File 'foo.bib' # open file or die "foo.bib: $! "; $entry = new Text::BibTeX::Entry $bibfile; # parse first entry Using this code, you might get an "undefined macro" warning for every entry parsed from foo.bib. Apart from the superficial annoyance of all those warning messages, the undefined macros are expanded as empty strings, meaning you lose any information about them---not good. You could always kludge it and forcibly define the month macros yourself. Prior to release 0.30, this had to be done by parsing a set of fake entries, but now "Text::BibTeX" provides a direct interface to the underlying macro table. You could just do this before parsing any entries: use Text::BibTeX qw(:macrosubs); # ... my %month = (jan => 'January', feb => 'February', ... ); add_macro_text ($macro, $value) while (($macro, $value) = each %month); But there's a better way that's more in keeping with how things are done under BibTeX (where default macros are defined in the style file): use "Text::BibTeX"'s object-oriented analogue to style files, called structure modules. "Text::BibTeX" provides a structure module, "Text::BibTeX::Bib", that (partially) emulates the standard style files of BibTeX 0.99, including the definition of month macros. Structure modules are specified on a per-file basis by using the "set_structure" method on a "Text::BibTeX::File" object. It's quite simple to tell "Text::BibTeX" that entries from $bibfile are expected to conform to the "Bib" structure (which is implemented by the "Text::BibTeX::Bib" module, but you don't really need to know that): $bibfile = new Text::BibTeX::File 'foo.bib' or die "foo.bib: $! "; $bibfile->set_structure ('Bib'); You probably shouldn't hardcode the name of a particular structure in your programs, though, as there will eventually be a multitude of structure modules to choose from (just as there are a multitude of BibTeX style files to choose from). My preferred approach is to make the structure a command-line option which defaults to "Bib" (since that's the only structure actually implemented as of this writing). How do I append to a BibTeX file? Just open it in append mode, and write entries to it as usual. Remember, a "Text::BibTeX::File" object is mainly a wrapper around an "IO::File" object, and the "Text::BibTeX::File::open" method (and thus "new" as well) is just a front-end to "IO::File::open". "IO::File::open", in turn, is a front-end either to Perl's builtin "open" (if called with one argument) or "sysopen" (two or three arguments). To save you the trouble of going off and reading all those man pages, here's the trick: if you pass just a filename to "Text::BibTeX::File"'s "new" method, then it's treated just like a filename passed to Perl's builtin "open": my $append_file = new Text::BibTeX::File ">>$filename" or die "couldn't open $filename for appending: $! "; opens $filename for appending. If, later on, you have an entry from another file (say $entry), then you can append it to $append_file by just writing it as usual: $entry->write ($append_file); See "append_entries" in the examples/ subdirectory of the "Text::BibTeX" distribution for a complete example. C LIBRARY
This section covers frequently-asked questions about btparse, the C component of btOOL. Is there a Python binding for btparse yet? Not that I know of. I haven't written one. If you do so, please let me know about it. SEE ALSO
btparse, Text::BibTeX AUTHOR
Greg Ward <gward@python.net> COPYRIGHT
Copyright (c) 1997-2000 by Gregory P. Ward. All rights reserved. This file is part of the Text::BibTeX library. This library is free software; you may redistribute it and/or modify it under the same terms as Perl itself. btparse, version 0.63 2012-05-12 btool_faq(3)
All times are GMT -4. The time now is 01:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy