Sponsored Content
Full Discussion: Will this work?
Top Forums Shell Programming and Scripting Will this work? Post 38730 by criglerj on Thursday 24th of July 2003 01:08:03 PM
Old 07-24-2003
In oombera's solution, the "if" is redundant, since `ls ...` only returned the files that were there, not the ones that weren't.

Assuming the "extensions", i.e., the filename endings after a period, are fixed, my solution would be something like this:
Code:
cd $copycomp/data
for ext in a b c d ; do
    if [ -f exsyctr1.$ext ] ; then
        # Create backup file per oombera, notice shell differences.
	cp $livecomp/exsyctrl.$ext .
    fi
done

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

how does this work???

can someone tell me the meaning of this commnad, If you want to see a grand total of CPU time for a program when it finishes running, you can use the time command. At the Unix prompt, enter: time java myprog Replace myprog with the name of the program you are running. The following is an... (1 Reply)
Discussion started by: ldpathak
1 Replies

2. UNIX for Dummies Questions & Answers

Script doesn't work, but commands inside work

Howdie everyone... I have a shell script RemoveFiles.sh Inside this file, it only has two commands as below: rm -f ../../reportToday/temp/* rm -f ../../report/* My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
Discussion started by: cheongww
2 Replies

3. UNIX for Advanced & Expert Users

how does this work....

1|foo|bar 2|usa|ll 3|usa|vg 4|usa|vg 5|bar|vg 6|usa|vg 7|usa|ll 8|uk|nn 9|foo|manu|bar 10|uk|bb 11|foo|mm 12|kuwait|jkj 13|kuwait|mm 14|dubai|hh awk '/foo/,/bar/' test_file1----command run at the prompt output should have been the first 3 lines...... 1|foo|bar (1 Reply)
Discussion started by: bishweshwar
1 Replies

4. UNIX for Dummies Questions & Answers

cant get this to work

whoami | grep < $1 | echo $1 trying to write a script that finds out who the user is and then takes occurences of that username from a file that is passed as an argument and then displays it (6 Replies)
Discussion started by: iago
6 Replies

5. Linux

How does it work?

Can anyone explain how Graphic LCD (CSTN / STN) work in Unix... From Graphic file thro driver code to display....? Thanks (1 Reply)
Discussion started by: nat123
1 Replies

6. Linux

Come and work for me! (UK)

********nothing too see here!!!****** (2 Replies)
Discussion started by: TonyChapman
2 Replies

7. Shell Programming and Scripting

ls -d does not work

Hi falks, I need to dispaly a list of only directories . As it written in the manual ,the command to do it is 'ls -d'. When i issue 'ls -d' i'm getting: tornado.orca.ent:DB10g :/home/oracle/Create_Database > ls -d . Is anyone have any idea why id does not display directories ,or maybe... (11 Replies)
Discussion started by: nir_s
11 Replies

8. IP Networking

NIC will not work, but it did work.

I have a client machine that was built and loaded with SCO UNIX 2.1.3, (yes it is old). The machine worked fine on the closed network that I tested on in my shop. I then had to change it to the network that it would be connected to. Below is the host file, router and subnet mask file that I usually... (0 Replies)
Discussion started by: NC user
0 Replies

9. Shell Programming and Scripting

My script work on Linux but not work in sunos.

My script work on Linux but not work in sun os. my script. logFiles="sentLog1.log sentLog2.log" intial_time="0 0" logLocation="/usr/local/tomcat/logs/" sleepTime=600 failMessage=":: $(tput bold)Log not update$(tput rmso) = " successMessage="OK" arr=($logFiles)... (7 Replies)
Discussion started by: ooilinlove
7 Replies

10. IP Networking

Discussion at work, would a router work pluging a cable in wan1 and lan1?

hi all. and sorry for the random question, but this sparkled a raging flame-war at work and i want more points of view situation a router, with linux of some sort, dhcp client requesting for ip in wan1 (as usual with wan ports) dhcp server listening in lan1, and assigning ip (as usual... (9 Replies)
Discussion started by: broli
9 Replies
PO4A-RUNTIME.7(7)                                       User Contributed Perl Documentation                                      PO4A-RUNTIME.7(7)

NAME
po4a-runtime - po4a and runtime gettext translation without Autotools Introduction With po4a-build, po4a also includes support for adding translation of runtime script output messages using gettext but without requiring the package to adopt Autotools and the typical ./configure process. Using example Makefile snippets, packages can harness intltool with minimal effort. Layout Documentation translation should NOT use the same po/ directory as the runtime translation. Whilst runtime translation can use directories other than po/, it is usually easiest to go with the convention. Multiple languages Just a word on packages that use scripts in multiple programming languages. A common mix is Perl and shell. Note bene: gettext WILL get confused and omit strings from one or other language unless file extensions are used for whichever is the least problematic language. When using multiple languages, experiment with various settings in po/Makevars until you get all the strings you need in the POT file. In particular, specifying two languages in po/Makevars can be problematic. Instead of: # Don't do this: XGETTEXT_OPTIONS = -L Perl -L Shell --from-code=iso-8859-1 Consider renaming (or providing symlink(s) for) all files for one of the languages involved and omitting the explicit -L options. The file extension only needs to exist during the time that po/POTFILES.in is being processed. The --keywords option can also be useful - see the xgettext documentation. Populating po/ So, create your top level po/ directory and then use the example files in /usr/share/doc/po4a/examples/ to populate it. LINGUAS Must exist, even if empty. Consists of a list of translations - each line not starting with a '#' must match an existing PO file. e.g. if LINGUAS contains a single line, 'fr', an fr.po file must exist alongside the LINGUAS file. $ cat po/LINGUAS cs de fr $ By convention, the LINGUAS file is sorted alphabetically but that is a manual process. POTFILES.in The list of files containing the messages that need to be translated at runtime - i.e. your scripts. If you've used the top level po/ directory, the paths should be relative to the top level directory, not the po/ directory itself. $ ls -l myscript.pl another.pl foo/support.pl po/ po/POTFILES.in $ cat po/POTFILES.in myscript.pl another.pl foo/support.pl $ Note that it is explicitly supported that the scripts themselves can contain strings for both runtime and documentation translation, e.g. using gettext functions for runtime and embedded POD content for documentation. So it is not a problem to have the same file listed in po/POTFILES.in and doc/po4a-build.conf Makevars-perl.example If your scripts are in Perl, copy this example file as po/Makevars and edit it to suit. Makevars-shell.example If your scripts are in shell, copy this example file as po/Makevars and edit it to suit. po4a-build.make Copy this example file as po/Makefile - it shouldn't need editing but you may want to keep it updated against /usr/share/doc/po4a/examples/po4a-build.make as it may need to be updated within po4a releases as the underlying intltool support changes. (The file itself was generated from another project using Autotools and intltool.) Building These snippets need to be added to your top level Makefile or whatever other method you use to prepare your sources for distribution. clean: $(MAKE) -C po/ clean install: $(MAKE) -C po/ install DESTDIR=$(DESTDIR) dist: $(MAKE) -C po/ pot (In an Autotools project, this would happen automatically by simply adding po to the "SUBDIRS" value in Makefile.am.) Maintenance Runtime translation isn't quite as easy as po4a-build in that adding a new translation does require editing po/LINGUAS, but apart from that, updating translations is merely a case of replacing the relevant PO file with the new version. Depending on how you prepare your source tarball, you may also need to list new PO files in the MANIFEST file or add to the script(s) that prepare the tarball. (That also applies to po4a-build.) Any *.mo or *.gmo files in po/ can be deleted / cleaned up. Copyright Whilst the example files are part of the po4a project, you are free to use, modify and distribute them in your own projects without needing to refer back to po4a or list the po4a team in your own copyright notices, in the same manner as other build tools like Automake itself. If you want to mention po4a, that is fine too. AUTHORS
Neil Williams <linux@codehelp.co.uk> perl v5.14.2 2012-05-17 PO4A-RUNTIME.7(7)
All times are GMT -4. The time now is 04:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy