Sponsored Content
Full Discussion: Reading a file in C shell
Top Forums UNIX for Dummies Questions & Answers Reading a file in C shell Post 302245847 by fpmurphy on Saturday 11th of October 2008 09:50:27 AM
Old 10-11-2008
One way ....
Code:
foreach line (`cat list.txt`)
    echo $line
end

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Reading file names from a file and executing the relative file from shell script

Hi How can i dynamically read files names from a list file and execute them from a single shell script. Please help its urgent Thanks in Advance (4 Replies)
Discussion started by: anushilrai
4 Replies

2. Shell Programming and Scripting

file reading through shell script

For reading a file through shell script I am using yhe code : while read line do echo $line done<data.txt It reads all the line of that file data.txt. Content of data.txt looks like: code=y sql=y total no of sql files=4 a.sql b.sql c.sql d.sql cpp=n c=y total no of c files=1 (4 Replies)
Discussion started by: Dip
4 Replies

3. Shell Programming and Scripting

File reading problem via shell script

Hi, Data file named parameter contains : DB=y Alter_def.sql Create_abc.sql SQL=y database.sql my_data.sql To read this file I use var_sql=$(awk -F= '$1 == "SQL" { print $2 }' parameter.txt) if then sql_f_name=`grep "\.sql" parameter.txt` echo $sql_f_name fi (2 Replies)
Discussion started by: Dip
2 Replies

4. Shell Programming and Scripting

Reading the Properties File From Shell script

Hi, I am new to the shell script please I need help for following question. I have properties file name called "com.test.properties" I have No of key values in this properties. com.person.name = xyz com.person.age = 55 com.person.address = hello I want read this properties but i... (1 Reply)
Discussion started by: venukjs
1 Replies

5. Shell Programming and Scripting

Error while reading from a file in shell script

Hi All, I'm writing a script to read a file line by line and then perform awk function on it. I am getting an error . My file has one name in it "James". I'm expecting my o/p to be youareJamesbond James ./users.sh: line 7: =: command not found #script to read file line by line #adding... (5 Replies)
Discussion started by: Irishboy24
5 Replies

6. Shell Programming and Scripting

reading the values from a file in C Shell for loop

Hi All, I need small help on for loop syntax in C shell. How can we read the values from a file (line by line) through C shell loop. For Ex: $Cat file1 data1 data2 data3 data4 $ I have to print those values in a variable and have to perform some steps... Can anyone help on... (2 Replies)
Discussion started by: raghu.iv85
2 Replies

7. UNIX for Dummies Questions & Answers

C-Shell script help reading from txt file

I need to write a C-Shell script with these properties: It should accept two arguments on the command line. The first argument is the name of a file which contains a list of names, and the second argument is the name of a directory. For each file in the directory, the script should print the... (1 Reply)
Discussion started by: cerce
1 Replies

8. Shell Programming and Scripting

Shell script reading file slow

I have shell program as below #!/bin/sh echo ======= LogManageri start ========== #This directory is getting the raw data from remote server Raw_data=/opt/ftplogs # This directory is ready for process the data Processing_dir=/opt/processing_dir # This directory is prcoessed files and... (4 Replies)
Discussion started by: Chenchireddy
4 Replies

9. UNIX for Dummies Questions & Answers

Reading XML file and print the values in the text file using Linux shell script

hi guys, i want help... Reding XML file and print the values into the text file using linux shell script file as per below xml file <sequence> <Filename>aldorzum.doc</Filename> <DivisionCode>US</DivisionCode> <ContentType>Template</ContentType> <ProductCode>VIMZIM</ProductCode> </sequence>... (1 Reply)
Discussion started by: sravanreddy
1 Replies
RANGE(3)								 1								  RANGE(3)

range - Create an array containing a range of elements

SYNOPSIS
array range (mixed $start, mixed $end, [number $step = 1]) DESCRIPTION
Create an array containing a range of elements. PARAMETERS
o $start - First value of the sequence. o $end - The sequence is ended upon reaching the $end value. o $step - If a $step value is given, it will be used as the increment between elements in the sequence. $step should be given as a posi- tive number. If not specified, $step will default to 1. RETURN VALUES
Returns an array of elements from $start to $end, inclusive. EXAMPLES
Example #1 range(3) examples <?php // array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) foreach (range(0, 12) as $number) { echo $number; } // The step parameter // array(0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100) foreach (range(0, 100, 10) as $number) { echo $number; } // Usage of character sequences // array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'); foreach (range('a', 'i') as $letter) { echo $letter; } // array('c', 'b', 'a'); foreach (range('c', 'a') as $letter) { echo $letter; } ?> NOTES
Note Character sequence values are limited to a length of one. If a length greater than one is entered, only the first character is used. SEE ALSO
shuffle(3), array_fill(3), foreach. PHP Documentation Group RANGE(3)
All times are GMT -4. The time now is 02:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy