Link to home
Start Free TrialLog in
Avatar of pvinodp
pvinodp

asked on

Unable to get atribute after using attr to set a attribute

Following a perl file :
//mBackup
#!/usr/bin/perl
...
...
my $cmd1 = "attr -s svnVer -V 13716 $$archiveName"; #my command

my $result1 = execute_command($cmd1);

print LOG "svnVer set : $result1 on $$archiveName \n";
------

I do see that the $result1 is set as 0. But when i query the file using
attr -g svnVer $$archiveName, i get:

attr_get: No data available
Could not get "svnVer" for /es/ss.bkup.3.0.10May13_061459.tgz
Avatar of ozo
ozo
Flag of United States of America image

my $cmd1 = "attr -s svnVer -V 13716 $$archiveName"; #my command
How did you assign a scalar reference to $archiveName?
Did you mean
my $cmd1 = 'attr -s svnVer -V 13716 $$archiveName';


my $result1 = execute_command($cmd1);
How did you declare sub execute_command?
Avatar of pvinodp
pvinodp

ASKER

Actually I copied the lines from already existing code..

    my $cmd = "cd $backup::tempDir; /bin/tar zcf $$archiveName $archives";
    my $result = execute_command($cmd);

#The above execution of command is successful. SO I used it to do my job. And all these 4 lines are consecutive lines. SO no access issues....

    my $cmd1 = "attr -s svnVer -V 13716 $$archiveName";
    my $result1 = execute_command($cmd1);




s
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pvinodp

ASKER

thanks for your answers