The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to read a file using shell ?? ranga27 Shell Programming and Scripting 7 09-18-2007 10:25 AM
Post Shell programming: Question about source a file and read data from the file ccwq Shell Programming and Scripting 3 08-04-2007 07:28 PM
Read words from file and create new file using K-shell. bsrajirs Shell Programming and Scripting 4 06-01-2007 09:15 AM
Read variable from file in a C shell script haouesse Shell Programming and Scripting 2 11-07-2006 06:34 AM
Read file - korn shell alienET Shell Programming and Scripting 5 04-06-2005 11:22 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 10-21-2002
Registered User
 

Join Date: Sep 2002
Posts: 9
How to read from a file in C shell?

Hi All,
I want to read some number from a file into a variable in C shell as follows.

I know that the syntax in ksh is
read x < file name

I dont know what's the equivalent for this in C Shell

Can some one pls. help me out?

Thanks in advance
raju
Forum Sponsor
  #2  
Old 10-21-2002
Cameron's Avatar
Registered User
 

Join Date: Nov 2001
Location: Brisbane, Australia
Posts: 490
Isn't it the same? I was under the impression that the read statement didn't differ from any of the various shells.
  #3  
Old 10-22-2002
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
Believe it or not, csh cannot read from a file. See question 1b here.

You will need to do something like:
set x=`cat y`
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 03:37 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0