<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ro">
		<id>https://wiki.lug.ro/index.php?action=history&amp;feed=atom&amp;title=Bash_script_template</id>
		<title>Bash script template - Revizia istoricului</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.lug.ro/index.php?action=history&amp;feed=atom&amp;title=Bash_script_template"/>
		<link rel="alternate" type="text/html" href="https://wiki.lug.ro/index.php?title=Bash_script_template&amp;action=history"/>
		<updated>2026-07-01T16:22:17Z</updated>
		<subtitle>Istoricul versiunilor pentru această pagină din wiki</subtitle>
		<generator>MediaWiki 1.27.7</generator>

	<entry>
		<id>https://wiki.lug.ro/index.php?title=Bash_script_template&amp;diff=6617&amp;oldid=prev</id>
		<title>Rz la 20 septembrie 2010 12:25</title>
		<link rel="alternate" type="text/html" href="https://wiki.lug.ro/index.php?title=Bash_script_template&amp;diff=6617&amp;oldid=prev"/>
				<updated>2010-09-20T12:25:35Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='ro'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Versiunea anterioară&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Versiunea de la data 20 septembrie 2010 12:25&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l73&quot; &gt;Linia 73:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Linia 73:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;case &amp;quot;$ACTIUNE&amp;quot; in&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;case &amp;quot;$ACTIUNE&amp;quot; in&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; fanistechestii) fanistechestii;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; fanistechestii) fanistechestii;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; faaltechestii) &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;fanaltechestii&lt;/del&gt;;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; faaltechestii) &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;faaltechestii&lt;/ins&gt;;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; *) fachestiaimplicita;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; *) fachestiaimplicita;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;esac&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;esac&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Rz</name></author>	</entry>

	<entry>
		<id>https://wiki.lug.ro/index.php?title=Bash_script_template&amp;diff=6609&amp;oldid=prev</id>
		<title>Rz: Pagină nouă: Un template simplu pentru un script BASH.  &lt;pre&gt; #!/bin/sh # bash script template versiunea 0.1 #DBG=1 VERSIUNE=0.1  # functie de utilizare utilizare() { HLP=&quot;programulmeu versiun...</title>
		<link rel="alternate" type="text/html" href="https://wiki.lug.ro/index.php?title=Bash_script_template&amp;diff=6609&amp;oldid=prev"/>
				<updated>2010-09-20T00:31:53Z</updated>
		
		<summary type="html">&lt;p&gt;Pagină nouă: Un template simplu pentru un script &lt;a href=&quot;/index.php?title=BASH&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;BASH (pagină inexistentă)&quot;&gt;BASH&lt;/a&gt;.  &amp;lt;pre&amp;gt; #!/bin/sh # bash script template versiunea 0.1 #DBG=1 VERSIUNE=0.1  # functie de utilizare utilizare() { HLP=&amp;quot;programulmeu versiun...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Pagină nouă&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Un template simplu pentru un script [[BASH]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
# bash script template versiunea 0.1&lt;br /&gt;
#DBG=1&lt;br /&gt;
VERSIUNE=0.1&lt;br /&gt;
&lt;br /&gt;
# functie de utilizare&lt;br /&gt;
utilizare() {&lt;br /&gt;
HLP=&amp;quot;programulmeu versiunea $VERSIUNE&lt;br /&gt;
utilizare: $0 [optiuni] primulargument [aldoileaargument]&lt;br /&gt;
&lt;br /&gt;
optiuni:&lt;br /&gt;
&lt;br /&gt;
    -param &amp;lt;param&amp;gt;	exemplu de argument ce necesita parametru&lt;br /&gt;
    -h, --help		acest ajutor&lt;br /&gt;
    --debug		activeaza informatii de depanare&lt;br /&gt;
    -v, --version	afiseaza versiunea&lt;br /&gt;
    &lt;br /&gt;
&amp;quot;;&lt;br /&gt;
echo &amp;quot;$HLP&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
terminare() {&lt;br /&gt;
    ecode=$1; shift&lt;br /&gt;
    echo &amp;quot;Eroare $ecode: $@&amp;quot;&lt;br /&gt;
    [ $DBG ] &amp;amp;&amp;amp; echo &amp;quot;Cod de iesire: $ecode&amp;quot;&lt;br /&gt;
    exit $ecode&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
fanistechestii() {&lt;br /&gt;
    echo &amp;quot;fac niste chestii...&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
faaltechestii() {&lt;br /&gt;
    echo &amp;quot;fac ALTE chestii...&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
fachestiaimplicita() {&lt;br /&gt;
    echo &amp;quot;fac chestia IMPLICITA...&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# parcurgere parametri&lt;br /&gt;
while [ $# -gt 0 ]; do&lt;br /&gt;
  case &amp;quot;$1&amp;quot; in &lt;br /&gt;
# optiunea necesita parametru&lt;br /&gt;
    -param ) [ $2 ] || terminare 2 &amp;quot;$1: necesita un parametru&amp;quot;; PARAMETRU=&amp;quot;$2&amp;quot;; shift 2 ;;&lt;br /&gt;
&lt;br /&gt;
    -fanistechestii ) ACTIUNE=fanistechestii; shift ;;&lt;br /&gt;
    -faaltechestii ) ACTION=faaltechestii; shift ;;&lt;br /&gt;
&lt;br /&gt;
    -q|--quiet) QUIET=1; shift;;&lt;br /&gt;
    -v|--verbose) VRB=1; shift;;&lt;br /&gt;
    -h | --help ) usage; exit 0 ;;&lt;br /&gt;
    -ver*|-version ) echo &amp;quot;Versiunea $VERSIUNE&amp;quot;  ; exit 1 ;;&lt;br /&gt;
    --debug) DBG=1; shift ;;&lt;br /&gt;
   * ) &lt;br /&gt;
    if [ -z $PRIMULARG ]; then PRIMULARG=&amp;quot;$1&amp;quot;&lt;br /&gt;
    elif [ -z $ALDOILEAARG ]; then ALDOILEAARG=&amp;quot;$1&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
    shift ;;&lt;br /&gt;
  esac&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
[ $DBG ] &amp;amp;&amp;amp; VRB=1 # activeaza informatii detaliate daca debugging e activat&lt;br /&gt;
[ $DBG ] &amp;amp;&amp;amp; echo &amp;quot;intru in programul principal&amp;quot;&lt;br /&gt;
[ $DBG ] &amp;amp;&amp;amp; echo &amp;quot;valori variabile interne: ACTIUNE=$ACTIUNE; PARAMETRU=$PARAMETRU; PRIMULARG=$PRIMULARG; etc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[ $VRB ] &amp;amp;&amp;amp; echo &amp;quot;afisez niste informatii detaliate...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$ACTIUNE&amp;quot; in&lt;br /&gt;
    fanistechestii) fanistechestii;;&lt;br /&gt;
    faaltechestii) fanaltechestii;;&lt;br /&gt;
    *) fachestiaimplicita;;&lt;br /&gt;
esac&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Am terminat.&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rz</name></author>	</entry>

	</feed>