Sponsored Content
Full Discussion: Construct path
Top Forums Shell Programming and Scripting Construct path Post 302760161 by Yoda on Wednesday 23rd of January 2013 12:58:32 PM
Old 01-23-2013
Using BASH script:
Code:
#!/bin/bash

PATH="/home/data/share/app/01/lang/ht/WEB/HTML
/home/data/share/app/01/lang/ht/WEB/JSP
/home/data/share/app/01/lang/ht/WEB/CSS"

for p in $PATH
do
        echo ${p/*lang//home/data/test/run}
done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem with looping construct

Hi all I have tried to search for this, but keep getting a MySQL db connect error, so am posing the question here, and taking a risk of incurring the wrath of the mods with my first post... I have the following test script: #!/bin/bash HTTPD=`/bin/ps -axcu | /usr/bin/grep httpd... (6 Replies)
Discussion started by: mikie
6 Replies

2. Shell Programming and Scripting

Embedding Perl construct in ksh...

Hi, I have an embedded Perl construct in a korn script. However, I cannot seem to access the shell variables that were declared outside this Perl section. This is how my script is written....I have also tried back-ticks where I assign the shell variable to my local perl variable, still... (1 Reply)
Discussion started by: svetlur
1 Replies

3. Shell Programming and Scripting

ksh construct

Hi Guys, could someone tell me what this ksh construct does typeset -r PROG_PWD=${0%/*} does I understand the -r for readonly but I would very much appreciate a definitive account of what this will set $PROG_PWD to. If I run this at the cmd line it it gets set to /usr/bin but I would... (2 Replies)
Discussion started by: ajcannon
2 Replies

4. Shell Programming and Scripting

if-else construct not working

Hi all, Sorry to ask this easy question but I am stuck. In a scenario i am executing one shell script which contains a if - else construct : if ; then echo $line $line >> successful_build.txt else $line >> failed_services.txt fi explaination : if the... (5 Replies)
Discussion started by: bhaskar_m
5 Replies

5. Shell Programming and Scripting

syntax error in the if construct

Hi can anyone tell me why is this code giving error mode=$1 if ] || ] then echo "MODES:" exit 1 fi Thanks (5 Replies)
Discussion started by: Anteus
5 Replies

6. Shell Programming and Scripting

construct a string with X number of spaces

I'd like to create a variable with the value of X number of space( no Perl please), printf seems to work, but , in following example,10 spaces becomes 1 space when assinged to a variable, Why? other solutions are welcome. $printf "=%10s=\n" = = $var=$(printf "=%10s=\n") echo... (4 Replies)
Discussion started by: honglus
4 Replies

7. Shell Programming and Scripting

Help with if-else construct

Hi all i have been trying to do a small 'question and answer' script using if-else statement and a combination of pipe. I have succeeded in allowing the user to login with user name and password stored in a sequence username/password in a file named "pass" like this: echo "please enter your... (14 Replies)
Discussion started by: arikutex
14 Replies

8. UNIX for Dummies Questions & Answers

awk construct unfamiliar to me

Please help me out: I've seen this construct awk '{...}1'several times, like in scrutinizer's today's post awk '{for(i=2;i<=NF;i++)if($i==$1)$i=RS $i}1' infilebut I can't find (manuals, man pages, internet FAQs,...) an explanation of what it does resp. stands for. Any hint is appreciated! (5 Replies)
Discussion started by: RudiC
5 Replies

9. Shell Programming and Scripting

For loop; how to construct a array with variables

Hi everybody!! Here is the thing; I have a trouble in this simple situation, I'm trying to write an array with all the arguments of a command. I mean, if I have: ./mycommand.sh aa bb cc dd I need to take an array like this: myarray=(aa bb cc dd) So I use a simple for loop like this: for... (4 Replies)
Discussion started by: andresgom
4 Replies

10. Shell Programming and Scripting

How would I construct a (possibly simple) IF statement?

Hi all, I thought this would be simple, but I've been having a lot of trouble trying to write this IF statement, if I may ask for help pls: In BASH, how would I construct the if statement: Should ONLY be true if USEROPTscript=="yes"]] AND $mode=="INSTALL" /or/ $mode=="CHANGE" ]]... (3 Replies)
Discussion started by: jmccoughlin
3 Replies
wml::std::lang(3)						     EN Tools							 wml::std::lang(3)

NAME
wml::std::lang - Multi-Lingual Support SYNOPSIS
#use wml::std::lang <lang:new id=xx [short]> <lang:area> (xx) ... (yy) ... </lang:area> <lang:set-wildcard ...> <lang:star: ...*..> <lang:star:href: index.*.html|index.html> <lang:star:slice: index.*.html> <lang:xx>...</lang:xx> <lang:xx: ...> <xx>...</xx> <xx: ...> <lang:current> <lang:list> DESCRIPTION
This include file provides high-level multi-lingual support via Slices. Its purpose is to define the slices ``"LANG_XX"'' according to the multi-lingual selection tags. The general intend of this slice-based approach is to use the defined slices in Pass 9 (Slice) via WMLs -o option. A typical shebang-line example for the use with a webserver's content negotiation feature is: #!wml -o (ALL-LANG_*)+LANG_EN:index.html.en -o (ALL-LANG_*)+LANG_DE:index.html.de Since WML 1.7.0, the "<lang:star:slice:>" tag is an alternative to this shebang-line. Before you can use a language, you have to define the corresponding tags via "<lang:new>". For instance when you want to use the languages english and german, use: <lang:new id=en> <lang:new id=de> Then the following tags are defined: <lang:en>...</lang:en> <lang:de>...</lang:de> <lang:en: ...> <lang:de: ...> i.e. for both languages a container tag and a simple tag is defined. The container tag is more readable while the simple tag is nicer for short variants. When the names "lang:xx" are still to large for you, you can use the "short" attribute to "<lang:new>" <lang:new id=en short> <lang:new id=de short> when then leads to the defintion of the shortcut variants: <en>...</en> <de>...</de> <en: ...> <de: ...> Additionally you always have the "<lang:area>"..."</lang:area>" container tag available which provides an alternative way of selecting the language in its body. It automatically surrounds the data between `"(xx)"' start tags with the corresponding "LANG_XX" slice. The following are equal: <lang:xx: Foo><lang:yy Bar> <lang:xx>Foo</lang:xx><lang:yy>Bar</lang:yy> <lang:area>(xx)Foo(yy)Bar</lang:area> Because these three lines internally get expanded to [LANG_XX:Foo:][LANG_YY:Bar:] [LANG_XX:Foo:][LANG_YY:Bar:] [LANG_XX:Foo:][LANG_YY:Bar:] There is one additional special tag: "<lang:star:>". This tag expands its attribute line like the "<lang:xx:>" tags but multiple times. Actually as much as defined languages exists ("<lang:new>"!). And in each expansion the asterisks (=stars) in the data gets replaced by the language identifier. Is is sometimes convenient to use another wildcard, e.g. when defining navigation bars. The "<lang:set-wildcard>" tag does the job. The attribute becomes the wildcard used in future substitutions. Without attribute, the default value is restored. You may specify any regular expression, and do not forget to escape special characters (the astersisk is in fact ``\*''). <lang:set-wildcard "%"> <lang:star: index.%.html> <lang:set-wildcard> There is a more specialized variant named "<lang:star:href:>" which is similar to "<lang:star:>" but treats its attribute value as a URL part and tries to check if it already exists. If it doesn't exist the tag expands the value without the star or an alternative value which can be appended with ``|alt-value''. The "<lang:star:slice:>" is another variant to help writing multi-lingual files quickly. It must come after all occurences of "<lang:new>" tags. <lang:star:slice: index.html.*> The `%BASE' form is recognized (see wml(1)) and an empty argument is equivalent to the string `"%BASE.*.html"'. But note that the use of this tag instead of the WML shebang line prevents WMk from doing its job, because WMk can not guess output filenames in this case. For complex multi-lingual documents, you may want to know in which language text is currently processed. This is achieved with <lang:current> which always returns current language (as defined in "<lang:new>" or an empty string when outside of any language portion. The macro <lang:list> prints the newline separated list of defined languages. EXAMPLE
The following is an example of a webpage "index.wml" with a multi-lingual header and hyperlink: #use wml::std::lang #use wml::std::href <lang:new id=en short> <lang:new id=de short> <lang:star:slice: index.html.*> <h1><en: Welcome><de: Willkommen></h1> <href name="The Hyperlink" url="<lang:star: index.*.html>"> <href name="The Hyperlink" url="<lang:star:href: index2.*.html|index2.html>"> When processed via $ wml index.wml The following two output files are generated (assuming that index2.html and only index2.de.html exists): index.html.en: <h1>Welcome</h1> <a href="index.en.html">The Hyperlink</a> <a href="index2.html">The Hyperlink</a> index.html.de: <h1>Willkommen</h1> <a href="index.de.html">The Hyperlink</a> <a href="index2.de.html">The Hyperlink</a> AUTHOR
Ralf S. Engelschall rse@engelschall.com www.engelschall.com Denis Barbier barbier@engelschall.com REQUIRES
Internal: P1, P2, P6, P9 External: -- SEE ALSO
slice(1) EN Tools 2014-04-16 wml::std::lang(3)
All times are GMT -4. The time now is 05:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy