Sponsored Content
Top Forums Shell Programming and Scripting Perl script 'system' linking to local shell script not working Post 302362407 by pludi on Friday 16th of October 2009 01:37:06 AM
Old 10-16-2009
Perl doesn't auto-complain if something non-critical doesn't work. If you want to call a shell script, but it can't find it (say, because you forgot to type the '.sh' that's part of the filename), system will fail with an error code, which you as the programmer have to catch and act upon (example in perldoc -f system).

And the ouput of the file can be written simpler as
Code:
open (HTMLFILE, "hellow.html");
while ($buffer = <HTMLFILE>)
{
    print $buffer;
}
close HTMLFILE;

or even
Code:
open (HTMLFILE, "hellow.html");
print while HTMLFILE;
close HTMLFILE;

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

shell script, reading and resetting local variables

Hello, I have a problem with trying to run a shell script that reads in user input, validates, and sets to a 'default' value if the input is not valid. I cannot get the portion of resetting to a default value to work. These lines are skipped, and the value of x is still whatever the user... (1 Reply)
Discussion started by: b888c
1 Replies

2. Shell Programming and Scripting

Shell script to create local homes

Hi I am trying to write a login script for network based clients (OSX) that looks up local accounts eg admin, root, etc and exits the script so that it doesn't apply to them. Then for everyone else I make folders eg movies, music, etc that are placed in local harddrive rather than the default... (11 Replies)
Discussion started by: Steve Adcock
11 Replies

3. Shell Programming and Scripting

Executing shell script on local machine

Hi guys, I need to run and test some shell script. At work, i work on ksh. I don't have any such software/client installed at home and i cannot always connect to work from home. At home i have Windows Vista. Is there a free and reliable software where i can run my ksh script? Please let me... (4 Replies)
Discussion started by: jakSun8
4 Replies

4. UNIX for Dummies Questions & Answers

Perl script not working

Hi Experts!! I have written a very simple script in perl.The script is : $ cat 1.pl #!/usr/bin/perl print "Hi there!\n"; When i ran the above perl script it is showing the following error: $ perl 1.pl -ksh: cd: bad substitution Can anybody,help on this ....as why this script is... (1 Reply)
Discussion started by: Amey Joshi
1 Replies

5. Shell Programming and Scripting

executing perl script from another perl script : NOT WORKING

Hi Folks, I have 2 perl scripts and I need to execute 2nd perl script from the 1st perl script in WINDOWS. In the 1st perl script that I had, I am calling the 2nd script main.pl =========== print "This is my main script\n"; `perl C:\\Users\\sripathg\\Desktop\\scripts\\hi.pl`; ... (3 Replies)
Discussion started by: giridhar276
3 Replies

6. Shell Programming and Scripting

expect script inside shell script not working.

Shell Scipt: temp.sh su - <$username> expect pass.exp Expect script: pass.exp #!/usr/bin/expect -f # Login ####################### expect "Password: " send "<$password>\r" it comes up with Password: but doesnt take password passed throguh file. (2 Replies)
Discussion started by: bhavesh.sapra
2 Replies

7. Shell Programming and Scripting

Copy a file from local host to a list of remote hosts --- perl script

Hi friends, i need to prepare a script ( in perl) i have a file called "demo.exe" in my local unix host. i have a list of remote hosts in a file "hosts.txt" now i need to push "demo.exe" file to all the hosts in "hosts.txt" file. for this i need to prepare a script(in perl, but shell... (5 Replies)
Discussion started by: siva kumar
5 Replies

8. Shell Programming and Scripting

To run a local shell script in a remote machine by passing arguments to the local shell script

I need to run a local shell script on a remote machine. I am able to achieve that by executing the command > ssh -qtt user@host < test.sh However, when I try to pass arguments to test.sh it fails. Any pointers would be appreciated. (7 Replies)
Discussion started by: Sree10
7 Replies

9. Shell Programming and Scripting

Shell script to call Oracle archive backup script when file system reaches threshold value

Hello All, I need immediate help in creating shell script to call archivebkup.ksh script when archive file system capacity reaches threshold value or 60% Need to identify the unique file system that reaches threshold value. ex: capacity ... (4 Replies)
Discussion started by: sasikanthdba
4 Replies

10. Shell Programming and Scripting

Except script to run a local shell script on remote server using root access

local script: cat > first.sh cd /tmp echo $PWD echo `whoami` cd /tmp/123 tar -cvf 789.tar 456 sleep 10 except script: cat > first #!/usr/bin/expect set ip 10.5.15.20 set user "xyz123" set password "123456" set script first.sh spawn sh -c "ssh $user@$ip bash < $script" (1 Reply)
Discussion started by: Aditya Avanth
1 Replies
PO4A-BUILD.CONF.5(5)                                    User Contributed Perl Documentation                                   PO4A-BUILD.CONF.5(5)

NAME
po4a-build.conf - configuration file for building translated content Introduction po4a-build.conf describes how "po4a-build" should build translated and untranslated documentation from a set of untranslated source documents and corresponding PO files. All supported formats, in all supported combinations, can be handled in a single po4a-build.conf configuration file and in a single call to "po4a-build". However, you can also choose to separate the po/ directories and have one configuration file for each run. (Call "po4a-build -f FILE" for each one.) Note that although po4a-build includes support for adding gettext support for translation of script output messages, po4a-build.conf itself has no bearing on such translations. po4a-build.conf only relates to translating static content like manpages. For po4a-build support of runtime message translation, see po4a-runtime(7). Supported formats Currently, "po4a-build" supports the following combinations: DocBook XML for sections 1 and 3 Typically used for manpages for shell scripts or other interpreters that do not have their own documentation format like POD. Suitable XML can be generated directly from an existing manpage using "doclifter" and "po4a-build" will then generate a POT file with no extra workload. The POT file can then be offered for translation and the PO files added to the relevant po/ directory. "po4a-build" will then prepare not only the untranslated manpage from the "doclifter" XML but also use "po4a" to prepare translated XML from the PO files and then build translated manpages from the XML. Manpages are generated using default support in docbook-xsl - the stylesheet used can be overridden using the "XSLFILE" setting in the "po4a-build" configuration file. DocBook XML for HTML The default stylesheet used to prepare the final HTML can be overridden using the "HTMLXSL" setting in the "po4a-build" configuration file. POD for sections 1, 3, 5 and 7 pod2man is used to convert POD content for each of the supported sections. Use "PODFILE" for section 1, "PODMODULES" for section 3, "POD5FILES" for section 5 and "POD7FILES" for section 7. For content in sections 5 or 7 (which tends to need a filename which is also used for section 1 content), if the filename includes the 5 or 7 as part of the filename, this (and any filename extension) will be automatically stripped. e.g. to prepare /usr/share/man/man7/po4a.7.gz: # POD files for section 7 POD7FILES="doc/po4a.7.pod" File contents Configuration values can appear in any order in the configuration file. Any content after a '#' is ignored. Any value that would always be empty can be dropped from the file. Some configuration fields are required - po4a-build could end up with nothing to do if required fields are empty. CONFIG Required. Name and location of the (temporary) "po4a" configuration file that "po4a-build" will generate and maintain. This file does not need to live in your version control system and can be safely cleaned up during the package build. # name and location of the config file CONFIG="_build/po4a.config" PODIR Required. Directory containing the PO files for ALL translations handled by this configuration file. All strings will be merged into a POT file in this directory and all PO files merged with that POT file. Any KEEP threshold (see below) will be applied across all strings from all input files specified in this file and all PO files in this directory. The directory does not need to be called 'po'. Please note, however, that some statistic tools expect the name to be 'po', therefor it is recommended to keep this name. # po directory for manpages/docs PODIR="po/pod" POTFILE Required. Path to the POT file (relative to the location of this configuration file) that will be generated, maintained and updated by "po4a-build" for these translations. # POT file path POTFILE="po/pod/po4a-pod.pot" BASEDIR Required. Base directory for writing out the translated content. # base directory for generated files, e.g. doc BASEDIR="_build" BINARIES Required. Even if only one package is built, at least one value is required here. The string itself is arbitrary but typically consists of the package name. Generated content will then appear in subdirectories of BASEDIR/BINARIES: _build/po4a/man/man1/foo.1 If the package builds more than one binary package (i.e. one source package and multiple .deb or .rpm files), this field can help isolate content intended for each target, making it easier to automate the build process. Separate strings with a space. # binary packages that will contain generated manpages BINARIES="po4a" KEEP Value to be passed directly to "po4a -k" to specify the threshold for correctly translated content before a particular translation is omitted from the build. Leave empty or remove to use the default (80%) or specify zero to force the inclusion of all content, even if completely untranslated. For full control over such behaviour, consider carefully which files are assigned to which po4a-build.conf configuration file. Note that having lots of files in one POT file can be more convenient for translators, especially if files have strings in common. Conversely, POT files with thousands of long strings are daunting for translators, leading to long string freezes. # minimal threshold for translation percentage to keep KEEP= XMLMAN1 DocBook XML files to generate manpages in section 1. Separate filenames with spaces. All files need to be in the XMLDIR directory. It is common practice to fold multiple XML files into one book, in order to provide a table of contents etc. If the book contains files also specified in XMLMAN3, only specify the XML files for section 1 here, not the book itself. If the book only contains content for this section, only specify the book file. # DocBook XML files for section 1 XMLMAN1="po4a-build.xml po4aman-display-po.xml po4apod-display-po.xml" XMLMAN3 DocBook XML files to generate manpages in section 3. Separate filenames with spaces. All files need to be in the XMLDIR directory. It is common practice to fold multiple XML files into one book, in order to provide a table of contents etc. If the book contains files also specified in XMLMAN1, only specify the XML files for section 3 here, not the book itself. If the book only contains content for this section, only specify the book file. # DocBook XML files for section 3 XMLMAN3="" XMLDIR Location of all the DocBook XML files. Currently, "po4a-build" expects to be able to find all files listed in XMLMAN1 and XMLMAN3 by looking for *.xml files in this directory. Must be specified if XMLMAN1 or XMLMAN3 are used. Paths are relative to the location of the configuration file. # location of the XML files XMLDIR="share/doc/" XMLPACKAGES Which packages, out of the list in BINARIES, use XML source content. If any values are given in XMLMAN1 or XMLMAN3, a value must be given here as well. # binary packages using DocBook XML & xsltproc XMLPACKAGES="po4a" DOCBOOKDIR Similar to XMLDIR but only used to prepare the translated DocBook files. If your package wants to use .sgml files, please discuss how these should be built on the po4a-devel mailing list. # pattern to find the .docbook files DOCBOOKDIR="" XSLFILE XSL stylesheet used to prepare the translated and untranslated content from the DocBook XML files. # XSL file to use for DocBook XML XSLFILE="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" PODFILE POD files for generating manpage content in section 1. Separate POD files with spaces. Paths, if used, need to be relative to the location of the specified configuration file. # POD files for section 1 PODFILE="po4a po4a-gettextize po4a-normalize scripts/msguntypot" PODMODULES Specialised support for Perl modules containing POD content - the module name will be reconstructed from the path (so this should be the typical Perl layout) and manpages are automatically put into section 3. # POD files for section 3 - module names regenerated from the path PODMODULES="lib/Locale/Po4a/*.pm" POD5FILES Arbitrary POD content for use generating manpages for section 5. Paths, if used, need to be relative to the location of the specified configuration file. For content in sections 5 or 7 (which tends to need a filename which is also used for section 1 content), if the filename includes the 5 or 7 as part of the filename, this (and any filename extension) will be automatically stripped. # POD files for section 5 POD5FILES="doc/po4a-build.conf.5.pod" POD7FILES Arbitrary POD content for use generating manpages for section 7. Paths, if used, need to be relative to the location of the specified configuration file. For content in sections 5 or 7 (which tends to need a filename which is also used for section 1 content), if the filename includes the 5 or 7 as part of the filename, this (and any filename extension) will be automatically stripped. # POD files for section 7 POD7FILES="doc/po4a.7.pod" PODPACKAGES Similar to XMLPACKAGES - any package expecting content to be built from POD files needs to include a value in PODPACKAGES. Required if any values are specified for PODFILE, PODMODULES, POD5FILES or POD7FILES. # binary packages using POD PODPACKAGES="po4a" HTMLDIR Subdirectory of BASEDIR to be used to output the untranslated and translated HTML output. # HTML output (subdirectory of BASEDIR) HTMLDIR="" HTMLFILE DocBook file to be converted to HTML (may be the same as one of the files in XMLMAN1 or XMLMAN3). Sections are not relevant to HTML output, so feel free to use the single book file here so that the HTML has a table of contents etc. # HTML DocBook file HTMLFILE="" HTMLXSL The default is to use a chunked XSL stylesheet. It is not currently supported to use more than one stylesheet per HTML run. # XSL file to use for HTML HTMLXSL="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl" AUTHORS
Neil Williams <linux@codehelp.co.uk> perl v5.14.2 2012-05-17 PO4A-BUILD.CONF.5(5)
All times are GMT -4. The time now is 02:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy