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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-08-2004, 02:35 PM
|
#1
|
Member
Registered: Nov 2004
Location: US
Distribution: Gentoo
Posts: 59
Rep:
|
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.
|
|
|
11-08-2004, 03:08 PM
|
#2
|
Senior Member
Registered: Dec 2001
Location: New Zealand
Distribution: Debian
Posts: 1,046
Rep:
|
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
|
|
|
11-08-2004, 08:11 PM
|
#3
|
Member
Registered: Nov 2004
Location: US
Distribution: Gentoo
Posts: 59
Original Poster
Rep:
|
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?
|
|
|
11-08-2004, 08:24 PM
|
#4
|
Senior Member
Registered: Dec 2001
Location: New Zealand
Distribution: Debian
Posts: 1,046
Rep:
|
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
|
|
|
11-09-2004, 09:34 AM
|
#5
|
Member
Registered: Nov 2004
Location: US
Distribution: Gentoo
Posts: 59
Original Poster
Rep:
|
syntax error near unexpected token `newline'
|
|
|
11-09-2004, 03:15 PM
|
#6
|
Senior Member
Registered: Dec 2001
Location: New Zealand
Distribution: Debian
Posts: 1,046
Rep:
|
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
|
|
|
11-09-2004, 05:56 PM
|
#7
|
Member
Registered: Nov 2004
Location: US
Distribution: Gentoo
Posts: 59
Original Poster
Rep:
|
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.
|
|
|
11-09-2004, 06:06 PM
|
#8
|
Senior Member
Registered: Dec 2001
Location: New Zealand
Distribution: Debian
Posts: 1,046
Rep:
|
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
|
|
|
11-09-2004, 08:24 PM
|
#9
|
Member
Registered: Nov 2004
Location: US
Distribution: Gentoo
Posts: 59
Original Poster
Rep:
|
>.>
ehh..heh. Actually, I did put the two <> there. But that's because just typing:
strfile myquotes
gives me this:
strfile: command not found
|
|
|
11-09-2004, 08:44 PM
|
#10
|
Senior Member
Registered: Dec 2001
Location: New Zealand
Distribution: Debian
Posts: 1,046
Rep:
|
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
|
|
|
11-10-2004, 11:44 AM
|
#11
|
Member
Registered: Nov 2004
Location: US
Distribution: Gentoo
Posts: 59
Original Poster
Rep:
|
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.)?
|
|
|
11-10-2004, 04:30 PM
|
#12
|
Senior Member
Registered: Dec 2001
Location: New Zealand
Distribution: Debian
Posts: 1,046
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 09:15 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|