how to use exec command in C shell


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to use exec command in C shell
# 1  
Old 11-12-2008
how to use exec command in C shell

i have a script where i am reading some lines from a file into another file..

script works fine in bash..

#!/usr/bin/csh
awk 'NR>20&&NR<32' try.sum | awk '{print $4 }' >io
awk 'NR>20&&NR<32' try.sum | awk '{print $9 }' >io1
awk 'NR>20&&NR<32' try.sum | awk '{print $14 }'>io2
exec 10<io
while (read LINE <&10)
ARRAY[$count]=$LINE
((count++))
end

how do i use the exec and read commands in c shell?
# 2  
Old 11-17-2008
You don't, pretty much.

Read the first section 1.1a in this
Csh Programming Considered Harmful
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Linux find command seems to not transmit all the result to the '-exec command'

Hello. From a script, a command for a test is use : find /home/user_install -maxdepth 1 -type f -newer /tmp/000_skel_file_deb ! -newer /tmp/000_skel_file_end -name '.bashrc' -o -name '.profile' -o -name '.gtkrc-2.0' -o -name '.i18n' -o -name '.inputrc' Tha command... (3 Replies)
Discussion started by: jcdole
3 Replies

2. Shell Programming and Scripting

What does the following exec command do it is in the shell file?

I have a shell script, research_dump_sub.sh the first 3 lines are below. the below two lines writing to log file, i am not finding the log file, how to locate, and what is the exec command doing exactly please. and the third line again calling/triggering the shell file. i didn't understood. ... (2 Replies)
Discussion started by: cplusplus1
2 Replies

3. Shell Programming and Scripting

Exec command - what is it doing here?

Hi all, Forgive me for asking for help with my first post, but I am struggling here. I've been asked to translate a bash script into a Windows script (probably batch or powershell, not sure yet), so the first step is obviously understand what the bash script is doing. But I have no experience in... (5 Replies)
Discussion started by: el_foz
5 Replies

4. Shell Programming and Scripting

exec command help

Hi, I have the following lines in a script : . . exec < some_file . . . I have very little idea about exec command. I would like to know what this does and what will happen if the file some_file does not exist. Specifically, I would like to know whether the lines following this... (5 Replies)
Discussion started by: elixir_sinari
5 Replies

5. UNIX for Dummies Questions & Answers

Exec command

Hi can some one explain the following command , It would really help if some can really elloborate on what is happening out here export PATH | exec /bin/sh ./auto_approve :q P.S: This is the first time i am using exec ,so an elloboration what does it do and what is the use of the :q will be... (1 Reply)
Discussion started by: Sri3001
1 Replies

6. Shell Programming and Scripting

exec command

How can I use the exec command to log my korn shell session to the screen and the log file? Currently I have this command: $exec 1> ${LOG} 2>&1 This logs the output to the log file only. I want it to go to the screen also. Is this possible with this command? thanks. (10 Replies)
Discussion started by: djehresmann
10 Replies

7. Shell Programming and Scripting

exec command

can any one pls explain the meaning of exec 1<&5 ?? its urgent (2 Replies)
Discussion started by: santosh1234
2 Replies

8. Shell Programming and Scripting

exec command

hai i want know the difference between two shell scripts those are 1) a=2004 echo $a #output------2004 exec < inputfile while read line do echo $a #output-------2004 a=2005 echo $line echo $a ... (1 Reply)
Discussion started by: g_s_r_c
1 Replies

9. UNIX for Dummies Questions & Answers

using the -exec command

linux redhat 8.0 I am getting accustomed to using the -exec command to get around my databse.. and use it to edit and update files..! is this more apllicable than jumping from one directory to the other.. I have set up the databse so that the inode #'s are accessable and can get me from one... (0 Replies)
Discussion started by: moxxx68
0 Replies
Login or Register to Ask a Question