11-29-2007
Well, you would certainly need to use "$SPAMH", since it has some spaces, but try using set -x to see what's going-on.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to pass 2 shell variable's ("START" and "END") define earlier in the script to this awk statement, but i can't seem to pass it on. PLs help.
set START = xxxx
set END = yyyy
set selected_file = `awk '/$START/,/$END/' filename` (24 Replies)
Discussion started by: Raynon
24 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I have a master BASH shell script where I define a bunch of variables:
$var1=why
$var2=is
$var3=(this so hard)
I would then like to call another shell script and pass these variables to it:
$script2 $var1 $var2 $var3
This works fine for var1 and var2. However, var3 is an array,... (9 Replies)
Discussion started by: msb65
9 Replies
3. Shell Programming and Scripting
Please help. I got these error. I'm try to pass variable extract from data-file.txt to sql file(select.sql).
cat: cannot open select
cat: cannot open *
cat: cannot open from
cat: cannot open user
cat: cannot open where
cat: cannot open name=$list;
#!/bin/bash
list=`sed q... (3 Replies)
Discussion started by: killboy
3 Replies
4. Shell Programming and Scripting
Hello expert.
I have a little problem here.
I write a script and stuck some bug to fix.
I found the problem was about * and a sample of script is below.
line 1 is print * out
but line 3 print all name of files in the script's path. (but I want *)
I want to contain * in variable... (3 Replies)
Discussion started by: MaYuMi
3 Replies
5. Shell Programming and Scripting
Hi All,
I am using SFTP command to transfer the file.
SRC=`pwd`
DIG=123
/bin/sftp -B /dev/stdin xyz@abc.net <<::
mput ${SRC}/GGG.${DIG}.tar.gz
bye
::
The problem is, after entring into sftp command, it is not taking variable values of SRC and DIG.
can someone help me... (0 Replies)
Discussion started by: ace_friends22
0 Replies
6. Shell Programming and Scripting
Hello again :)
Am currently trying to write a function which will delete a record from a file.
The code currently looks as such:
function deleteRecord() {
clear
read -p "Please enter the ID of the record you wish to remove: " strID
... (2 Replies)
Discussion started by: U_C_Dispatj
2 Replies
7. Red Hat
Hi all,
Hereby wish to have your advise for below:
Main concept is
I intend to get current directory of my script file.
This script file will be copied to /etc/init.d.
A string in this copy will be replaced with current directory value.
Below is original script file:
... (6 Replies)
Discussion started by: cielle
6 Replies
8. UNIX for Dummies Questions & Answers
Hi!
I was looking for files to clean out, and I remembered reading somewhere that you could pipe the output of grep to rm. But I prefer to mv stuff to ~/.Trash/
I thought I'd try something like this:
ls ~/Library/Preferences/ |grep '.*.\.iTunes\.plist\..*' |xargs -J % mv % ~/.Trash/
I... (12 Replies)
Discussion started by: sudon't
12 Replies
9. Shell Programming and Scripting
Hi All,
How to pass date variable to a query?
I have tried the below one , but it's not working.
ost.ksh
#!/bin/ksh
v_date=$1
var=$(sqlplus -s $ORACON <<ENDOFSQL
SELECT TO_DATE('$v_date','DD-MON-YYYY'),-1) FROM DUAL;
exit;
ENDOFSQL
)
#End
I have executed as below. (7 Replies)
Discussion started by: ROCK_PLSQL
7 Replies
10. UNIX for Beginners Questions & Answers
Hello All,
Hope you're doing well !
I am trying below command to be passed in a shell script, header_date_14 is a variable and $1 is the name of a file I intend to pass as a command line argument, however command line argument is not being accepted.
header_date_14=$(m_dump... (8 Replies)
Discussion started by: ektubbe
8 Replies
LEARN ABOUT DEBIAN
dr::tarantool::spaces
DR::Tarantool::Spaces(3pm) User Contributed Perl Documentation DR::Tarantool::Spaces(3pm)
NAME
DR::Tarantool::Spaces - spaces container
SYNOPSIS
use DR::Tarantool::Spaces;
my $s = new DR::Tarantool::Spaces({
1 => {
name => 'users', # space name
default_type => 'STR', # undescribed fields
fields => [
qw(login password role),
{
name => 'counter',
type => 'NUM'
},
{
name => 'something',
type => 'UTF8STR',
},
{
name => 'opts',
type => 'JSON',
}
],
indexes => {
0 => 'login',
1 => [ qw(login password) ],
2 => {
name => 'my_idx',
fields => 'login',
},
3 => {
name => 'my_idx2',
fields => [ 'counter', 'something' ]
}
}
},
0 => {
...
}
});
my $f = $s->pack_field('users', 'counter', 10);
my $f = $s->pack_field('users', 1, 10); # the same
my $f = $s->pack_field(1, 1, 10); # the same
my $ts = $s->pack_keys([1,2,3] => 'my_idx');
my $t = $s->pack_primary_key([1,2,3]);
DESCRIPTION
The package describes all spaces that You use. It supports the following field types:
NUM, NUM64, STR
- standard tarantool <http://tarantool.org> types.
UTF8STR
- the same as STR, but string will be utf8-decoded after extracting from database.
INT & INT64
- the same as NUM and NUM64, but contain signed values.
JSON
- the filed will be encoded by JSON::XS before inserting and decoded after extracting from database.
METHODS
new
my $spaces = DR::Tarantool::Spaces->new( $spaces );
space
Returns space object by number or name.
my $space = $spaces->space('name');
my $space = $spaces->space(0);
pack_field
packs one field before making database request
my $field = $spaces->pack_field('space', 'field', $data);
unpack_field
unpacks one field after extracting data from database
my $field = $spaces->unpack_field('space', 'field', $data);
pack_tuple
packs tuple before making database request
my $t = $spaces->pack_tuple('space', [ 1, 2, 3 ]);
unpack_tuple
unpacks tuple after extracting data from database
my $t = $spaces->unpack_tuple('space', @fields);
SPACES methods
new
constructor
use DR::Tarantool::Spaces;
my $space = DR::Tarantool::Space->new($no, $space);
name
returns space name
number
returns space number
pack_field
packs field before making database request
unpack_field
unpacks field after extracting data from database
pack_tuple
packs tuple before making database request
unpack_tuple
unpacks tuple after extracting data from database
COPYRIGHT AND LICENSE
Copyright (C) 2011 Dmitry E. Oboukhov <unera@debian.org>
Copyright (C) 2011 Roman V. Nikolaev <rshadow@rambler.ru>
This program is free software, you can redistribute it and/or
modify it under the terms of the Artistic License.
VCS
The project is placed git repo on github: https://github.com/unera/dr-tarantool/ <https://github.com/unera/dr-tarantool/>.
perl v5.14.2 2012-06-04 DR::Tarantool::Spaces(3pm)