LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-31-2011, 11:58 AM   #1
Why9999
LQ Newbie
 
Registered: Aug 2011
Posts: 6

Rep: Reputation: Disabled
read text file


Sorry, I'm quite the newbie. I'm looking at a korn script here and the first command is this:

read_text_file()

But when I Google on the above, I don't see that this is a std Linux/Unix command.

Assuming that's the case, how do I find out where this function or whatever it is is?
 
Old 08-31-2011, 12:07 PM   #2
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,464

Rep: Reputation: Disabled
Hi and welcome!
This is not a command that you type on a command line. It is a statement in a korn script.
Quote:
Assuming that's the case, how do I find out where this function or whatever it is is?
You look here.
Is there any reason you're particularly interested in korn scripts rather than bash scripts? Are you trying to learn programming using scripts? There are loads of tutorials for that.
ciao,
jdk
 
Old 08-31-2011, 12:13 PM   #3
Why9999
LQ Newbie
 
Registered: Aug 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jdkaye View Post
Hi and welcome!
This is not a command that you type on a command line. It is a statement in a korn script.

You look here.
Is there any reason you're particularly interested in korn scripts rather than bash scripts? Are you trying to learn programming using scripts? There are loads of tutorials for that.
ciao,
jdk
This was written by another person and was a Korn shell script.

I, of course, don't mind searching for this, but I don't know what to search on. Would this be under global variables or something?
 
Old 08-31-2011, 12:17 PM   #4
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,464

Rep: Reputation: Disabled
Well it might help to give more information. Why not explain what you're trying to do and you might get some good suggestions about how to do it. I can't really say how to search for something when I don't know what it is you're looking for. A short clear description of what you want should do the trick.

If all you want to do is read a text file, you can use the cat command as in
Code:
cat /path to text file/filename
or load it into a text editor like vim or nano.
ciao,
jdk

Last edited by jdkaye; 08-31-2011 at 12:20 PM.
 
Old 08-31-2011, 12:21 PM   #5
Why9999
LQ Newbie
 
Registered: Aug 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jdkaye View Post
Well it might help to give more information. Why not explain what you're trying to do and you might get some good suggestions about how to do it. I can't really say how to search for something when I don't know what it is you're looking for. A short clear description of what you want should do the trick.
ciao,
jdk
I'm just trying to understand this person's script. I did a crontab and am looking at the scripts that are running there, so I'm not really trying to do anything but comprehend what is going on.

This was the first line in the shell script and I don't see it defined anywhere else.
 
Old 08-31-2011, 12:23 PM   #6
Why9999
LQ Newbie
 
Registered: Aug 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Why9999 View Post
This was written by another person and was a Korn shell script.

I, of course, don't mind searching for this, but I don't know what to search on. Would this be under global variables or something?
Nevermind. I figured it out.
 
Old 08-31-2011, 12:23 PM   #7
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,464

Rep: Reputation: Disabled
I'm sorry to ask the obvious but if it's supposed to be a korn script have you tried googling korn manual or korn tutorial or korn guide?
jdk
 
Old 08-31-2011, 12:37 PM   #8
Why9999
LQ Newbie
 
Registered: Aug 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jdkaye View Post
I'm sorry to ask the obvious but if it's supposed to be a korn script have you tried googling korn manual or korn tutorial or korn guide?
jdk
Sure, but I thought this was some kind of weird functionality because I couldn't find anything that I was looking for. But I figured it out. Gracias...
 
Old 08-31-2011, 12:44 PM   #9
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,427

Rep: Reputation: 2827Reputation: 2827Reputation: 2827Reputation: 2827Reputation: 2827Reputation: 2827Reputation: 2827Reputation: 2827Reputation: 2827Reputation: 2827Reputation: 2827
And are you going to share with the rest of the kids so when someone else does search and finds your question they get an idea?
 
Old 08-31-2011, 12:57 PM   #10
Why9999
LQ Newbie
 
Registered: Aug 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by grail View Post
And are you going to share with the rest of the kids so when someone else does search and finds your question they get an idea?
Ummm, well, I feel a little boneheaded:

He was of course just defining a function. I thought it was an isolated command, but then realized the error of my ways...
 
Old 08-31-2011, 08:03 PM   #11
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,260

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
Just in case its useful to anyone, here is a link to complete ksh docs http://kornshell.com/
 
Old 08-31-2011, 08:40 PM   #12
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,427

Rep: Reputation: 2827Reputation: 2827Reputation: 2827Reputation: 2827Reputation: 2827Reputation: 2827Reputation: 2827Reputation: 2827Reputation: 2827Reputation: 2827Reputation: 2827
Don't beat yourself up too badly ... we have all had that 'ahuh' moment with different things and now when someone
finds your post they might have the same moment
 
Old 08-31-2011, 08:45 PM   #13
ramkatral
Member
 
Registered: Aug 2011
Location: Tryon, NC
Distribution: Slackware x64, Arch x64
Posts: 74

Rep: Reputation: 12
Man, it's always a learning experience. I think the most seasoned guys asks some of the dumbest questions sometimes. It's just life! You get to where you try to look too deeply and miss the obvious simple things.
 
  


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
[SOLVED] read a text file distrubute its contents on different text files magische_vogel Programming 13 02-26-2011 07:51 PM
Help Me(how to read text file using arrays in c++) rezen85 Programming 2 10-19-2010 10:50 AM
Cannot read text from text file and store it in a variable using shell script anurupr Linux - Newbie 2 03-03-2010 02:38 PM
how do i read a particular line from the text file.. pdklinux79 Linux - Newbie 3 06-09-2008 08:16 PM
Need C++ Program to Read from Text File waXed Programming 5 10-26-2007 02:21 PM


All times are GMT -5. The time now is 01:12 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration