03-06-2015
Yes, it fixed the problem..
Would like to know why the new value could not be assigned to the Index inside ?
thanks again,
emily
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Anybody know what's wrong with this syntax?
awk -v job="$job" 'BEGIN { FS="|"}
{print $1,$2," ",$4," ",$3\n,$5,"\n"}' list
It's keeping give me this message:
awk: syntax error near line 1
awk: bailing out near line 1
It seems awk has problem with my BEGIN command.
Any... (8 Replies)
Discussion started by: whatisthis
8 Replies
2. UNIX for Dummies Questions & Answers
Does anybody know how to print a variable passed to awk command?
awk -F"|" 'BEGIN {print $job,"\n","Question \n"} {print $1,$2$4," ",$3}' "job=$job1" file1
I am trying to pass job the variable job1.
the output is blank.
?? (3 Replies)
Discussion started by: whatisthis
3 Replies
3. Shell Programming and Scripting
I want to instert Category:XXXXX into the 2. line
something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong:
sed "2i\\${n}Category:$cat\n"
Sample:
Titel Blahh Blahh abllk sdhsd sjdhf
Blahh Blah Blahh
Blahh
Should look like... (2 Replies)
Discussion started by: lowmaster
2 Replies
4. Shell Programming and Scripting
Hi,
Can you please help. I am scripting in sh and I am trying to simply copy one directory to another but for some reason my variables are not recognised?
echo "The latest version of the program is being found......."
cd $SOFTWARE/src/$progname
version=`ls $SOFTWARE/src/$progname | grep... (13 Replies)
Discussion started by: cyberfrog
13 Replies
5. UNIX for Dummies Questions & Answers
I know this script is crummy, but I was just messing around.. how do I get sed's insert command to allow variable expansion to show the filename?
#!/bin/bash
filename=`echo $0`
/usr/bin/sed '/#include/ {
i\
the filename is `$filename`
}' $1
exit 0 (8 Replies)
Discussion started by: glev2005
8 Replies
6. Shell Programming and Scripting
The following subroutine prints 1 instead of the content of the Equipment variable. Can someone tell me why?
#!c:/perl/bin/perl.exe
#
use strict 'vars';
my $Equipments = "data/equips.txt";
unless (open(EQUIP_FH, "$Equipments")) {
print "errors: $Equipments\n"; # This line prints... (1 Reply)
Discussion started by: tqlam
1 Replies
7. UNIX for Advanced & Expert Users
Hi,
I am facing a challenge in fixing an issue in my installation scripts.Here is a situation:
There are 3 files which are invoked at a below given order:
Installer.ksh----->Installer.xml(Ant script)------->common.ksh
I am outputting a message from common.ksh at a terminal, after that trying to... (3 Replies)
Discussion started by: baig_1988
3 Replies
8. Shell Programming and Scripting
I am having difficulties with the fllowing script:
!/bin/sh
voicemaildir=/var/spool/asterisk/voicemail/$1/$2/INBOX/
echo `date` ':' $voicemaildir >> /var/log/voicemail-notify.log
for audiofile in `ls $voicemaildir/*.wav`; do
transcriptfile=${audiofile/wav/transcript}
... (4 Replies)
Discussion started by: ghurty
4 Replies
9. Shell Programming and Scripting
I have a script.
#!/bin/sh
cur_$1_modify_time=Hello
echo "cur_$1_modify_time"
When I run like
sh /root/script1 jj
I expect value "Hello" being assigned to variable "cur_jj_modify_time" and output being "Hello" ie echoing $cur_jj_modify_time
But the output comes as
# sh... (3 Replies)
Discussion started by: anil510
3 Replies
10. Shell Programming and Scripting
In the bash below the variable date displays in the echo. However when I use it in the for loop it does not. Basically, the user inputs a date then that date is converted to the desired format of (month-day-year, no leading 0). That input is used in the for loop to return every file that matches... (5 Replies)
Discussion started by: cmccabe
5 Replies
LEARN ABOUT DEBIAN
class::accessor::children::fast
Class::Accessor::Children::Fast(3pm) User Contributed Perl Documentation Class::Accessor::Children::Fast(3pm)
NAME
Class::Accessor::Children::Fast - Faster, child-class/accessor generation
SYNOPSIS
BEFORE (WITHOUT THIS)
package MyClass::Foo;
use base qw( Class:Accessor::Fast );
__PACKAGE__->mk_ro_accessors(qw( jacob michael joshua ethan ));
package MyClass::Bar;
use base qw( Class:Accessor::Fast );
__PACKAGE__->mk_ro_accessors(qw( emily emma madison isabella ));
package MyClass::Baz;
use base qw( Class:Accessor::Fast );
__PACKAGE__->mk_ro_accessors(qw( haruka haruto miyu yuto ));
AFTER (WITH THIS)
package MyClass;
use base qw( Class::Accessor::Children::Fast );
__PACKAGE__->mk_child_ro_accessors(
Foo => [qw( jacob michael joshua ethan )],
Bar => [qw( emily emma madison isabella )],
Baz => [qw( haruka haruto miyu yuto )],
);
DESCRIPTION
This module automagically generates child classes which have accessor/mutator methods.
This module inherits "Class::Accessor::Fast" to make accessors.
METHODS
This module provides the following methods in addition to all methods provided by "Class::Accessor::Fast".
mk_child_accessors
MyClass->mk_child_accessors( Foo => @fields, ... );
This generates a child class named "MyClass::Foo" which have accessor/mutator methods each named in "@fields".
mk_child_ro_accessors
MyClass->mk_child_ro_accessors( Bar => @fields, ... );
This generates a child class named "MyClass::Bar" which have read-only accessors (ie. true accessors).
mk_child_wo_accessors
MyClass->mk_child_wo_accessors( Baz => @fields, ... );
This generates a child class named "MyClass::Baz" which have write-only accessor (ie. mutators).
SEE ALSO
Class::Accessor::Children
Class::Accessor::Fast
AUTHOR
Yusuke Kawasaki <http://www.kawa.net/>
COPYRIGHT AND LICENSE
Copyright (c) 2007 Yusuke Kawasaki. All rights reserved. This program is free software; you can redistribute it and/or modify it under the
same terms as Perl itself.
perl v5.10.0 2007-08-16 Class::Accessor::Children::Fast(3pm)