hi friends....


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting hi friends....
# 1  
Old 07-10-2008
hi friends....

hi friend i am facing problem in taking input from a file to the variable ..

read fname
if [ -d $fname ]
then
cd $fname
pwd
ls > new_temp1
cat new_temp1
fi

terminal=`tty`
exec < $new_temp1
while read line
do
echo $line
done
exec < $terminal


my code is this but this code is unable to getting input from new_temp1
suggest me how can i get the output from the new_test1 file


t: line 16: $new_temp1: ambiguous redirect getting this error..
thanks in advance....
# 2  
Old 07-10-2008
Try this:

Code:
while read line
do
  echo "$line"
done < new_temp1

Regards
# 3  
Old 07-11-2008
Computer thanks.....

Quote:
Originally Posted by Franklin52
Try this:

Code:
while read line
do
  echo "$line"
done < new_temp1

Regards
thanks now my code is executing.........
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. What is on Your Mind?

You Want to Spend Time with Friends and Family a UNIX.com Cartoon Explainer

Well, this was kinda fun and different: You Want to Spend Time with Friends and Family a UNIX.com Cartoon Explainer https://youtu.be/6jPDpuxI2OA You want to spend time with friends and family. But you are stuck on some problem... Your Linux or Unix code is buggy and you don't know... (1 Reply)
Discussion started by: Neo
1 Replies

2. What is on Your Mind?

Time to have FUN my Unix/Linux friends...(One liners)...MUST read.. !!

As a mind refresher, I was thinking to start a new thread for ONE LINERS....funny/weird or any technical one liners.... Let me start first...... ================================= #!/bin/ssh #The Unix Guru's View of Sex unzip ; strip ; touch ; grep ; finger ; mount ; fsck ; more ; yes ;... (3 Replies)
Discussion started by: Rahulpict
3 Replies

3. Shell Programming and Scripting

hi friends..........

hello friends ........ i want to visit the directory recusvely through and shell script . and want to get the output of " stat " command for each file .i tried by this way but unable to visit the each file . #!/bin/bash echo "enter the file name" read file fun() ... (3 Replies)
Discussion started by: newson
3 Replies

4. UNIX for Advanced & Expert Users

hello friends

:confused: i'am new to this unix environment.can any one give guidence in how to c programs for inter communication process (4 Replies)
Discussion started by: shaffiullabaig
4 Replies

5. IP Networking

hi friends

i have been in trouble please help me out i have developed a message queue.it is a simple message queue program after running it give error like NO SPACE LEFT ON DEVICE what is this error how could i solve this problem i am working on solaris9.2 (2 Replies)
Discussion started by: ramneek
2 Replies
Login or Register to Ask a Question