Hi,
Can anyone advise me on how to use array on Bash? I am really confuse in how eval is link to array... What i wan to do is let say i have an index of an array of 50. Store either 'N' or 'Y' or "NA" in each index. how to i go about doing it.. then lastly how to i print all the values out in... (2 Replies)
Hello,
I am trying to use the awk getline command to populate an array from a flat file.
Has anyone done this before?
So we have file1:
a
b
c
d
I want to create an array like index that contains these four elements (8 Replies)
I want to get a status code array for the commands in eval.
For example,
eval "ls abc; ls def; ls $HOME"
I want to get the status code for each ls command in eval. Is there any way to make it?
Thanks. (2 Replies)
I try to get a number of elements in an array, using dynamic array name.
I need the array name to be dynamic.
The array name is constructed as 'inf_ln_$nmb', where $nmb is a file line number
So, say I have the arr 'inf_ln_4':
> for (( el=0; el<${#inf_ln_4}; el++ )); do
> echo "$el:... (1 Reply)
I am trying to write a script that runs another script consecutively and records the PID of the called script each time it runs in an array.
I put in an echo statement to check the PID, when the script runs no PID is output, and the array seems to be empty. I assume it is problem with my code,... (3 Replies)
Hi all,
some small script with eval turned me to crazy.
my OS is linux
Linux s10-1310 2.6.16.53-0.8.PTF.434477.3.TDC.0-smp #1 SMP Fri Aug 31 06:07:27 PDT 2007 x86_64 x86_64 x86_64 GNU/Linux
below script works well
#!/bin/bash
eval ssh remotehost date
eval ssh remotehost ls
below... (1 Reply)
Hi Guys,
I've got a script that runs and collects statistics from one of our machines and outputs the data into a csv file. Now, that script runs fine and I managed to create another one (with a lot of help from this forum!!) to trim the csv file down to all the data that I need, rather than all... (9 Replies)
I have a question on how can I assign a output of a function to a variable which is executed in background.
Here is my example
$ cat sample_program.sh
#!/bin/ksh
exec_func () {
sleep 1
v=`expr $1 + 100`
print $v
}
export OUT_ARR
date
for i in 1 2
do
OUT_ARR=`exec_func $i` &... (1 Reply)
Discussion started by: mohan_kumarcs
1 Replies
LEARN ABOUT CENTOS
git::svn::fetcher
Git::SVN::Fetcher(3) User Contributed Perl Documentation Git::SVN::Fetcher(3)NAME
Git::SVN::Fetcher - tree delta consumer for "git svn fetch"
SYNOPSIS
use SVN::Core;
use SVN::Ra;
use Git::SVN;
use Git::SVN::Fetcher;
use Git;
my $gs = Git::SVN->find_by_url($url);
my $ra = SVN::Ra->new(url => $url);
my $editor = Git::SVN::Fetcher->new($gs);
my $reporter = $ra->do_update($SVN::Core::INVALID_REVNUM, '',
1, $editor);
$reporter->set_path('', $old_rev, 0);
$reporter->finish_report;
my $tree = $gs->tmp_index_do(sub { command_oneline('write-tree') });
foreach my $path (keys %{$editor->{dir_prop}) {
my $props = $editor->{dir_prop}{$path};
foreach my $prop (keys %$props) {
print "property $prop at $path changed to $props->{$prop}
";
}
}
foreach my $path (keys %{$editor->{empty}) {
my $action = $editor->{empty}{$path} ? 'added' : 'removed';
print "empty directory $path $action
";
}
foreach my $path (keys %{$editor->{file_prop}) { ... }
foreach my $parent (keys %{$editor->{absent_dir}}) {
my @children = @{$editor->{abstent_dir}{$parent}};
print "cannot fetch directory $parent/$_: not authorized?
"
foreach @children;
}
foreach my $parent (keys %{$editor->{absent_file}) { ... }
DESCRIPTION
This is a subclass of "SVN::Delta::Editor", which means it implements callbacks to act as a consumer of Subversion tree deltas. This
particular implementation of those callbacks is meant to store information about the resulting content which git svn fetch could use to
populate new commits and new entries for unhandled.log. More specifically:
o Additions, removals, and modifications of files are propagated to git-svn's index file $GIT_DIR/svn/$refname/index using git update-
index.
o Changes in Subversion path properties are recorded in the "dir_prop" and "file_prop" fields (which are hashes).
o Addition and removal of empty directories are indicated by entries with value 1 and 0 respectively in the "empty" hash.
o Paths that are present but cannot be conveyed (presumably due to permissions) are recorded in the "absent_file" and "absent_dirs"
hashes. For each key, the corresponding value is a list of paths under that directory that were present but could not be conveyed.
The interface is unstable. Do not use this module unless you are developing git-svn.
DEPENDENCIES
SVN::Delta from the Subversion perl bindings, the core Carp, File::Basename, and IO::File modules, and git's Git helper module.
"Git::SVN::Fetcher" has not been tested using callers other than git-svn itself.
SEE ALSO
SVN::Delta, Git::SVN::Editor.
INCOMPATIBILITIES
None reported.
BUGS
None.
perl v5.16.3 2013-06-10 Git::SVN::Fetcher(3)