LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-08-2004, 02:35 PM   #1
MiniMe001
Member
 
Registered: Nov 2004
Location: US
Distribution: Gentoo
Posts: 59

Rep: Reputation: 15
custom fortune files


this is bugging the hell out of me. I was going to make my own file to use with the fortune command, but I can't read the damn .dat files. At first, it looks like mpeg, but if I cilck on it, it looks like a spreadsheet. -_-' Can't open it with anything.
 
Old 11-08-2004, 03:08 PM   #2
mjrich
Senior Member
 
Registered: Dec 2001
Location: New Zealand
Distribution: Debian
Posts: 1,046

Rep: Reputation: 45
You'll probably need to use the <strfile> command to create the random access dbase out of your standard text file, e.g. <strfile customfortunes>.

Have a quick read of the mini-howto at http://www.freiburg.linux.de/~flug/p...ies-HOWTO.html for more info

Cheers,

mj
 
Old 11-08-2004, 08:11 PM   #3
MiniMe001
Member
 
Registered: Nov 2004
Location: US
Distribution: Gentoo
Posts: 59

Original Poster
Rep: Reputation: 15
uhhuh. Well, exactly what do I do with strfile??
Here's what I thought you meant:
make a text file with something like:
one
%
two
%
three
open a terminal and type: strfile myquotes.txt
HAH, yeah, that didn't work. So I added the >, thinking I was supposed to have that.
Nope.

So what do I do?
 
Old 11-08-2004, 08:24 PM   #4
mjrich
Senior Member
 
Registered: Dec 2001
Location: New Zealand
Distribution: Debian
Posts: 1,046

Rep: Reputation: 45
What happened when you typed <strfile myquotes.txt> ...? Did it produce a file named myquotes.txt.dat ? If so, then you're on the right track. To fit in with the fortune format, you'll probably want to leave off the .txt extension, of course.

Then, after installing it with the correct permissions, try running <fortune myfortune>.

Cheers,

mj
 
Old 11-09-2004, 09:34 AM   #5
MiniMe001
Member
 
Registered: Nov 2004
Location: US
Distribution: Gentoo
Posts: 59

Original Poster
Rep: Reputation: 15
syntax error near unexpected token `newline'
 
Old 11-09-2004, 03:15 PM   #6
mjrich
Senior Member
 
Registered: Dec 2001
Location: New Zealand
Distribution: Debian
Posts: 1,046

Rep: Reputation: 45
Perhaps post a portion of your customfortunes text file here - there may be a part of it that is fooling strfile (can you see any reason why an error would occur at the point that it did when processing the text file ?).

Cheers,

mj
 
Old 11-09-2004, 05:56 PM   #7
MiniMe001
Member
 
Registered: Nov 2004
Location: US
Distribution: Gentoo
Posts: 59

Original Poster
Rep: Reputation: 15
entire file:
test1
%
test2
%
test3
%
test4
%
test5

Is there something I missed? There IS a trailing return at the end of the file, but I can't seem to get rid of it with gedit or kate. ^^; just reappears when I reopen it.
 
Old 11-09-2004, 06:06 PM   #8
mjrich
Senior Member
 
Registered: Dec 2001
Location: New Zealand
Distribution: Debian
Posts: 1,046

Rep: Reputation: 45
Hmmmm... It worked fine for me just now, both with and without a newline at the end of the file. You are just typing
Code:
strfile customfortunes
and nothing else, presumably ? The < and > were just for illustration purposes above, not for actual use (where they begin to redirect input and output willynilly).

Cheers,

mj
 
Old 11-09-2004, 08:24 PM   #9
MiniMe001
Member
 
Registered: Nov 2004
Location: US
Distribution: Gentoo
Posts: 59

Original Poster
Rep: Reputation: 15
>.>
ehh..heh. Actually, I did put the two <> there. But that's because just typing:
strfile myquotes
gives me this:
strfile: command not found
 
Old 11-09-2004, 08:44 PM   #10
mjrich
Senior Member
 
Registered: Dec 2001
Location: New Zealand
Distribution: Debian
Posts: 1,046

Rep: Reputation: 45
Righto, so either it's not installed (usually at /usr/bin/strfile), or it's not in your path. Try it as root, and if you still have no joy then you'll have to install the full fortune package. Under Debian, this is fortune-mod. Under Mandrake, it's probably the same but you may need to check.

Cheers,

mj
 
Old 11-10-2004, 11:44 AM   #11
MiniMe001
Member
 
Registered: Nov 2004
Location: US
Distribution: Gentoo
Posts: 59

Original Poster
Rep: Reputation: 15
woahhoh.. worked under root. Weird. Is that because it is linked there but not elsewhere? If so, can I link it elsewhere (not important, but hey.)?
 
Old 11-10-2004, 04:30 PM   #12
mjrich
Senior Member
 
Registered: Dec 2001
Location: New Zealand
Distribution: Debian
Posts: 1,046

Rep: Reputation: 45
If strfile worked as root, and not as an ordinary user then it's probably not in your path. Have a look at the line beginning with PATH in /etc/profile, and maybe add /usr/bin - or wherever strfile is located on your system.

Cheers,

mj
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
custom install cd base-config custom mithereal Debian 6 09-11-2005 03:48 PM
custom geforce video card--custom module? bandofmercy Linux - Hardware 3 10-14-2004 06:52 PM
Disabling fortune p1az Slackware 3 06-29-2004 05:12 PM
fortune drigz Linux - Software 3 06-26-2004 10:40 AM
Fortune r00tshell Slackware 6 07-15-2003 09:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration