The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

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 02:25 PM
Post Shell programming: Question about source a file and read data from the file ccwq Shell Programming and Scripting 3 08-04-2007 11:28 PM
Read words from file and create new file using K-shell. bsrajirs Shell Programming and Scripting 4 06-01-2007 01:15 PM
Read variable from file in a C shell script haouesse Shell Programming and Scripting 2 11-07-2006 09:34 AM
Read file - korn shell alienET Shell Programming and Scripting 5 04-06-2005 03:22 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-21-2002
rajugp1 rajugp1 is offline
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
  #2 (permalink)  
Old 10-21-2002
Cameron's Avatar
Cameron Cameron is offline Forum Advisor  
Registered User
  
 

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

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,122
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`
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:22 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0