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 > 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 and shell scripting languages 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 06:48 AM
0403-027 The parameter list is too long. romiljain UNIX for Dummies Questions & Answers 5 02-21-2008 08:52 PM
Script Error: 13192.sumr: 0403-016 Cannot find or open the file. jgruenwald Shell Programming and Scripting 0 01-21-2008 12:08 PM
Error Message: find: cannot open /: Stale NFS file handle ezsurf SUN Solaris 1 10-11-2007 08:04 PM
0403-057 Syntax error at line 70. pls help OMONI UNIX for Dummies Questions & Answers 2 07-20-2005 04:37 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-04-2005
karthee karthee is offline
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.
  #2 (permalink)  
Old 06-04-2005
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
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
  #3 (permalink)  
Old 06-05-2005
tom_xx_hu@yahoo tom_xx_hu@yahoo is offline
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
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 10:31 AM.


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