![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Windows & DOS: Issues & Discussions All Windows and DOS questions should go here as well. Discuss UNIX to Windows (Desktop or Server) here! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| simple CSH Script behaves differently on Solaris and RedHat Linux | two reelers | Shell Programming and Scripting | 2 | 02-02-2009 08:39 AM |
| Script behaves different when run from cron vs. manually | billtwild | Shell Programming and Scripting | 2 | 11-21-2008 05:54 PM |
| Script behaving differently on two servers | mhssatya | UNIX for Advanced & Expert Users | 5 | 09-13-2006 02:28 PM |
| Script behaving differently in Crontab.. | newtoxinu | Shell Programming and Scripting | 4 | 10-01-2004 01:22 PM |
| Script behaving differently in Crontab.. | newtoxinu | UNIX for Advanced & Expert Users | 1 | 09-30-2004 04:00 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Awk script in DOS and Linux behaves differently :(
Hi,
I have an awk script which performs simple operations of variable assignments and finally printing the variables in custom form. Code:
BEGIN {FS=OFS="\n"}
{
v1=substr($0,1,15)
v2=substr($0,16,200)
v3=substr($0,216,20)
print v1 "|" v2 "|" v3
}
a.awk:7: ^ invalid char '' in expression" I tried to debug the above script line by line and I find that the second line (assigning value to v2) is causing issues on Linux. Wondering, if are there any limitations of using substr to read $0 repeatedly has issues on Linux? Kindly help. Thanks and Regards, Vidya Last edited by Yogesh Sawant; 04-01-2009 at 01:47 PM.. Reason: added code tags |
|
||||
|
Thanks a lot. Instead of using Editplus to edit the file remotely, when I edited the file directly on Linux, it worked fine for me too. I guess, Editplus inserted some sort of carriage return when saved on Windows which would have caused the problem.
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|