Creating a dictionary with domain name adjuncted


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Creating a dictionary with domain name adjuncted
# 8  
Old 05-05-2013
Quote:
Originally Posted by gimley
Dear durden_tyler,
I tried this out of sheer desperation. When I run the perl script
below (cut and paste)
Code:
-lne 
if (/^(.*?=)([^(]*)(.*)/) {
($x,$y,$z)=($1,$2,$3);
print "$x$y" if $y ne "";
while ($z =~ m/(\([^(]+)/g) { print "$x$1" }
}

I get the following error
Code:
syntax error at editkamil.pl line 2, near ") {"
syntax error at editkamil.pl line 6, near "}"
Execution of editkamil.pl aborted due to compilation errors.

On the other hand if I remove the
Code:
-lne

I get no output at all.
I hope this clarified the situation.
"Dear" gimley,

It's not surprising you got no output at all, since you did not execute the script I posted.

Quote:
Originally Posted by gimley
...
When I run the perl script
below (cut and paste)
Code:
-lne 
if (/^(.*?=)([^(]*)(.*)/) {
($x,$y,$z)=($1,$2,$3);
print "$x$y" if $y ne "";
while ($z =~ m/(\([^(]+)/g) { print "$x$1" }
}

...
I don't see the word "perl" in there, so it's unfair to call it a "perl script". You gotta have a **close** look at the script I posted and try again.
# 9  
Old 05-05-2013
Hello,
I copied the script exactly as it was on the page only removing the inverted commas
Code:
perl -lne if (/^(.*?=)([^(]*)(.*)/) {
($x,$y,$z)=($1,$2,$3);
print "$x$y" if $y ne "";
while ($z =~ m/(\([^(]+)/g) { print "$x$1" }
}

and ran it as a perl script on command prompt. I got the following message

Code:
syntax error at editkamil.pl line 1, near ") {"
syntax error at editkamil.pl line 5, near "}"
Execution of editkamil.pl aborted due to compilation errors.

Is this because I am trying to run the perl script from outside. I know no other method of running a script from outside. This is why in my earlier mail, I had "eaten up" the word perl. This time I have kept it as such and tried to run the script.
Hope this explains things. Many thanx for your patience. I am 60+ and accustomed to C programming. Perl is a learning experience for me.
# 10  
Old 05-07-2013
Quote:
Originally Posted by gimley
...I copied the script exactly as it was on the page only removing the inverted commas
...
It's not an exact copy if you remove the inverted commas (I believe you are referring to single quotes). What happens if you don't do that?

Quote:
Originally Posted by gimley
...
Is this because I am trying to run the perl script from outside.
...
Yes, that's correct. The "outside" or the shell doesn't understand Perl syntax.
# 11  
Old 05-07-2013
Hello,
Many thanks for your reply.
I ran the scriptt as such with the single quotes and here is what I got
Code:
String found where operator expected at editkamil.pl line 5, near "}'"
  (Might be a runaway multi-line '' string starting on line 1)
        (Missing semicolon on previous line?)
syntax error at editkamil.pl line 5, near "}'"
Execution of editkamil.pl aborted due to compilation errors.

I really don't understand what goes wrong.
# 12  
Old 05-07-2013
Quote:
Originally Posted by gimley
...
I ran the scriptt as such with the single quotes and here is what I got
Code:
String found where operator expected at editkamil.pl line 5, near "}'"
  (Might be a runaway multi-line '' string starting on line 1)
        (Missing semicolon on previous line?)
syntax error at editkamil.pl line 5, near "}'"
Execution of editkamil.pl aborted due to compilation errors.

...
Copy and paste the part of your screen where you run your script. In other words, copy (straight from your screen, no modifications) and post the following:

(a) the command you executed, followed by
(b) the error message you saw

You've posted (b) above, but not (a).

Last edited by durden_tyler; 05-07-2013 at 11:04 PM..
# 13  
Old 05-07-2013
Hello,
As mentioned I created a perl script called editkamil.pl
On dos prompt I gave the command:
perl editkamil.pl <FN>
and got the error dump which i forwarded in my earlier mail.
As a matter of curiosity, are you running PERL in a shell?
I can only run perl on command line.
Many thanks once more for your interest
# 14  
Old 05-08-2013
Quote:
Originally Posted by gimley
... I created a perl script called editkamil.pl
...
That's the problem.

Quote:
Originally Posted by gimley
...As a matter of curiosity, are you running PERL in a shell?...
Yes.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Creating verbal structures from a dictionary and a template

My main aim here is to create a database of verbs in a language to Hindi. The output if it works well will be put up on a University site for researchers to use for Machine Translation. This because one of the main weaknesses of MT is in the area of verbs. Sorry for the long post but the problem... (4 Replies)
Discussion started by: gimley
4 Replies

2. Programming

Python Web Page Scraping Urls Creating A Dictionary

I have thrown in the towel and cant figure out how to do this. I have a directory of html files that contain urls that I need to scrape (loop through) and add into a dictionary. An example of the output I would like is: bigbadwolf.htlm: https://www.blah.com, http://www.blahblah.com,... (5 Replies)
Discussion started by: metallica1973
5 Replies

3. Homework & Coursework Questions

How to create a dictionary using cygwin

1. The problem statement, all variables and given/known data: Create a dictionary using cygwin. Display the following menu at the start of execution 1-add a word in the dictionary # specify the meaning 2-search a word # if word exists, show the meaning of the word 2-delete a word... (2 Replies)
Discussion started by: kpopfreakghecky
2 Replies

4. Windows & DOS: Issues & Discussions

How to: Linux BOX in Windows Domain (w/out joining the domain)

Dear Expert, i have linux box that is running in the windows domain, BUT did not being a member of the domain. as I am not the System Administrator so I have no control on the server in the network, such as modify dns entry , add the linux box in AD and domain record and so on that relevant. ... (2 Replies)
Discussion started by: regmaster
2 Replies

5. UNIX for Dummies Questions & Answers

Unix dictionary.

Hey, I am looking for an inbuilt unix dictionary.I tried to look at the path /usr/dict/word and I do not find anything any dict directory in the /usr folder. Can anyone please tell me how to find out this dictionary? Thanks Lee. (1 Reply)
Discussion started by: leepan2008
1 Replies

6. Shell Programming and Scripting

how to give dictionary effect ?

Hello, In google: if we type the text like :- It gives us a question saying :- I want to know how to write a shell script to give this Dictionary effect. example:If we give "lst" then it corrects us saying "list". Can you please help me with a sample code! friends..... (3 Replies)
Discussion started by: nsharath
3 Replies

7. UNIX for Advanced & Expert Users

dictionary words in vim

how can i get the dictionary words in vim using keyboard keys? and how can i get the current directory filename? (1 Reply)
Discussion started by: lakshmananindia
1 Replies

8. UNIX for Dummies Questions & Answers

unix dictionary location

ne1 know where unixs built in dictionary is??? is it in this place /usr/dict/words????? (1 Reply)
Discussion started by: sinner
1 Replies

9. UNIX for Dummies Questions & Answers

nt to unix dictionary

Has anyone ever encountered a good publication or site that is basically a NT(or DOS) to UNIX Dictionary / Translator (i.e. service = daemon or ren = mv, etc) - I've found lots of websites that list like 20 or so command equivalents, but that's about it- what about differences in system folders,... (3 Replies)
Discussion started by: gsumers
3 Replies

10. UNIX for Dummies Questions & Answers

Dictionary File

Could someone please tell me where the dictionary file for Spell is stored. And is it in a text format so I can read it in a windows text editor. Thanks (1 Reply)
Discussion started by: Rukshan
1 Replies
Login or Register to Ask a Question