10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I am using following script to name the file base of some values
#!/bin/sh
sourcefile=$1
awk '
BEGIN{ n = 1; name = "FILEFILE12" n ".txt"; }
{
if (substr($0,1,10) == "FILEFILE12")
{
close (name)
n++
a = substr($0,11,10);
b = substr($0,21,5);
name = b "_Src_" a ".txt"
}... (6 Replies)
Discussion started by: manish8484
6 Replies
2. Shell Programming and Scripting
I have a file which contains certain records about users. the row length is always fixed to 205 characters.
Now I want to read each record line from the file, substring some portion out of it and put into another file. But I have observed that my script is trimming the extra spaces I have used for... (4 Replies)
Discussion started by: Pramit
4 Replies
3. Shell Programming and Scripting
Hello all. I am a newb obviously and a bit stumped on this, so any help gratefully accepted.
The script is extracting metadata from individual mp3 files, then (hopefully will be) sorting them into newly-created subdirectories. I have filtered out the relevant metadata and have the album names... (8 Replies)
Discussion started by: spoovy
8 Replies
4. Shell Programming and Scripting
friends,
I have a script in solaris 10 SPARC system which is like this
date '+Time: %m/%d/%y %H:%M:%S'
echo " GDBRR GDLRR GDBWR GDLWR GDRRR GDRWR "
sar -b 10 10 |/usr/xpg4/bin/awk '!/Average/ && !/SunOS/ && !/bread/ {$1="";T=$2;T1=$3;T2=$5;T3=$6;T4=$8;T5=$9}{print(T"\t",... (1 Reply)
Discussion started by: achak01
1 Replies
5. Shell Programming and Scripting
I'm using this thread as an example, but can't seem to apply it to my situation.
I'm trying to strip the trailing slash (/) from an input argument. Here's a snippet of my command line input and the troublesome code:
$ script_name -s "../pathname/dir/"
snip 8< ...
while getopts :s:... (5 Replies)
Discussion started by: ricksj
5 Replies
6. UNIX for Advanced & Expert Users
Hi,
How can I remove the unwanted spaces in the line.
123456 789 ABC DEF. - I wanna remove the sapces in this line, I need the output 123456789ABCDEF.
Pls help me...... (3 Replies)
Discussion started by: sharif
3 Replies
7. Shell Programming and Scripting
I have a variable that calls in a string from txt file. Problem is the string comes with an abundance of white spaces trailing it. Is there any easy way to trim the tailing white spaces off at the end? Thanks in advance. (9 Replies)
Discussion started by: briskbaby
9 Replies
8. Solaris
Hi my lovely friends,
Im writing one pgm in which i trying to assign some values like
$var='Jun 6'
but if i do echo of this $var will trim the spaces expect one space.
$echo $var
$Jun 6
But if var='Jun 28', then this will works fine
$echo $var
$Jun 28
this is required to exctract... (2 Replies)
Discussion started by: Lokesha
2 Replies
9. Shell Programming and Scripting
Hi,
my var is:
PATH_LOG=/opt/WebSphere/CR Comune Roma.log
a filename which contains blank chars.
How can I call it from prompt ?
Ex:
ls $PATH_LOG or
cat $PATH_LOG
tks,
Carmen- (2 Replies)
Discussion started by: Carmen123
2 Replies
10. Shell Programming and Scripting
I am trying to strip all leading and trailing spaces of a shell variable using either awk or sed or any other utility, however unscuccessful and need your help.
echo $SH_VAR | command_line Syntax.
The SH_VAR contains embedded spaces which needs to be preserved. I need only for the leading and... (6 Replies)
Discussion started by: jerardfjay
6 Replies
ERUBIS(1) User Commands ERUBIS(1)
NAME
erubis - eRuby style template engine for multiple languages
SYNOPSIS
erubis [..options..] [file ...]
DESCRIPTION
Embedded templating engine for multiple languages. Erubis will take a template file as input and output code to convey that data in the
language specified. The following output languages are supported:
* Ruby
* PHP
* C
* Java
* Scheme
* Perl
* JavaScript
OPTIONS
-h, --help
help
-v version
-x show converted code
-X show converted code, only ruby code and no text part
-N numbering: add line numbers (for '-x/-X')
-U unique: compress empty lines to a line (for '-x/-X')
-C compact: remove empty lines (for '-x/-X')
-b body only: no preamble nor postamble (for '-x/-X')
-z syntax checking
-e escape (equal to '--E Escape')
-p pattern
embedded pattern (default '<% %>')
-l lang
convert but no execute (ruby/php/c/java/scheme/perl/js)
-E e1,e2,...
enhancer names (Escape, PercentLine, BiPattern, ...)
-I path
library include path
-K kanji
kanji code (euc/sjis/utf8) (default none)
-c context
context data string (yaml inline style or ruby code)
-f datafile
context data file ('*.yaml', '*.yml', or '*.rb')
-T don't expand tab characters in YAML file
-S convert mapping key from string to symbol in YAML file
-B invoke 'result(binding)' instead of 'evaluate(context)'
--pi=name
parse '<?name ... ?>' instead of '<% ... %>'
supported properties:
* (common)
--escapefunc=nil
: escape function name
--pattern="<% %>"
: embed pattern
--trim=true
: trim spaces around <% ... %>
--preamble=nil
: preamble (no preamble when false)
--postamble=nil
: postamble (no postamble when false)
--escape=nil
: escape expression or not in default
* (basic) * (pi)
--pi="rb"
: PI (Processing Instrunctions) name
--embchar="@"
: char for embedded expression pattern('@{...}@')
* ruby * php * c
--indent=""
: indent spaces (ex. ' ')
--out="stdout"
: output file pointer name
* java
--indent=""
: indent spaces (ex. ' ')
--buf="_buf"
: output buffer name
--bufclass="StringBuffer" : output buffer class (ex. 'StringBuilder')
* scheme
--func="_add"
: function name (ex. 'display')
* perl
--func="print"
: function name
* javascript
--docwrite=true
: use 'document.write()' when true
EXAMPLES
Run 'erubis -l php example.ephp' to convert the embedded document to php code.
example.ephp:
<?xml version="1.0"?>
<html>
<body>
<p>Hello <%= $user %>!</p>
<table>
<tbody>
<% $i = 0; %>
<% foreach ($list as $item) { %>
<% $i++; %>
<tr bgcolor="<%= $i % 2 == 0 ? '#FFCCCC' : '#CCCCFF' %>">
<td><%= $i %></td>
<td><%== $item %></td>
</tr>
<% } %>
</tbody>
</table>
</body>
</html>
SEE ALSO
http://rubyforge.org/projects/erubis/
erubis 2.6.2 January 2009 ERUBIS(1)