The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
get_source[34]: 0403-057 Syntax error at line 66 : `"' is not matched. vishal_ranjan Shell Programming and Scripting 1 05-15-2008 03:48 AM
0403-027 The parameter list is too long. romiljain UNIX for Dummies Questions & Answers 5 02-21-2008 05:52 PM
Script Error: 13192.sumr: 0403-016 Cannot find or open the file. jgruenwald Shell Programming and Scripting 0 01-21-2008 09:08 AM
Error Message: find: cannot open /: Stale NFS file handle ezsurf SUN Solaris 1 10-11-2007 05:04 PM
0403-057 Syntax error at line 70. pls help OMONI UNIX for Dummies Questions & Answers 2 07-20-2005 01:37 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-03-2005
Registered User
 

Join Date: Jun 2005
Posts: 1
getting error 0403-016 Cannot find or open the file while reading a long line

Hi,

I have an requirement of reading a long line of 7000 chars and cutting it

iam doing this :

while read -r x
do
echo $x

.........
done < `cat filename`

when iam doing this it is giving me "0403-016 Cannot find or open the file."

Can anyone let how this can be done.
Reply With Quote
Forum Sponsor
  #2  
Old 06-04-2005
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
The whole UUOC is throwing things out of whack....

while read whatever; do
# whatever
done < filename

Depending on your shell, you may well encounter limits with a line that long anyway....

On a modern shell like bash (on Linux), this copes quite well
Code:
$ for i in `seq 1 7000`
>   echo -n "a" >> longline
> done
$ echo "" >> longline
$ wc -c longline
      7001   longline
$ while read line; do
>   echo ${line} 
> done < longline
aaaaaaaaa.....
.
....aaaaaaaa
$
Cheers
ZB
Reply With Quote
  #3  
Old 06-04-2005
Registered User
 

Join Date: May 2005
Posts: 40
Quote:
Originally Posted by karthee
Hi,

I have an requirement of reading a long line of 7000 chars and cutting it

iam doing this :

while read -r x
do
echo $x

.........
done < `cat filename`

when iam doing this it is giving me "0403-016 Cannot find or open the file."

Can anyone let how this can be done.
For the line,

echo $x

Think about what could happen if there is semicolon/quote/comma within $x.
You may want to try, in bash
echo -E "$r"

Tom
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:10 AM.


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