![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#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. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
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
$
ZB |
|
#3
|
|||
|
|||
|
Quote:
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 |
|||
| Google The UNIX and Linux Forums |