nawk --- can't open file ??


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting nawk --- can't open file ??
# 1  
Old 02-07-2011
nawk --- can't open file ??

While i am trying to execute nawk in korn shell iam getting this error.

nawk: can't open file $directory../../../filename.

When the file is in home directory it is executing. But its not able to find file in other directory.

Thanks
# 2  
Old 02-07-2011
Quote:
Originally Posted by Diddy
While i am trying to execute nawk in korn shell iam getting this error.

nawk: can't open file $directory../../../filename.

When the file is in home directory it is executing. But its not able to find file in other directory.

Thanks
I guess your relative//absolute path is wrong....
why $directory is not expanded?
# 3  
Old 02-08-2011
other possibility is if directory name is a variable, please double check to make sure it's having trailing "/".
(Assuming the filename is just filename).
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Nawk Problem - nawk out of space in tostring on

Hi.. i am running nawk scripts on solaris system to get records of file1 not in file2 and find duplicate records in a while with the following scripts -compare nawk 'NR==FNR{a++;next;} !a {print"line"FNR $0}' file1 file2duplicate - nawk '{a++}END{for(i in a){if(a-1)print i,a}}' file1in the middle... (12 Replies)
Discussion started by: Abhiraj Singh
12 Replies

2. Shell Programming and Scripting

file manipulation using nawk

Legends, I have two files (f1, f2) with below output. file f1 contains: TSCparser14 irons1 1 NORD_BALT_02 -- 0 gaps (0 missing messages), 0 seq no resets TSCparser15 irons1 1 NORD_BALT_05 -- 0 gaps (0 missing messages), 0 seq no resets TSCparser21 irons1 ... (11 Replies)
Discussion started by: sdosanjh
11 Replies

3. Shell Programming and Scripting

Reformat file using nawk

Hi all, I have a file with records that look something like this, "Transaction ID",Date,Email,"Card Type",Amount,"NETBANX Ref","Root Ref","Transaction Type","Merchant Ref",Status,"Interface ID","Interface Name","User ID" nnnnnnnnn,"21 Nov 2011 00:10:47",someone@hotmail.co.uk,"Visa... (2 Replies)
Discussion started by: dazedandconfuse
2 Replies

4. Shell Programming and Scripting

Help nawk parse file

Hello, Hope you are doing fine. I have a file in following format. I only want to process the data inside the section that comes after #DATE,CODE,VALUE #ITEMS WITH CORRECTIONS ....... #DATE,CODE,VALUE 2011-08-02, ID1, 0.30 2011-08-02, ID2, 0.40 2011-08-02, ID3, 0.50 ...... Means... (3 Replies)
Discussion started by: srattani
3 Replies

5. Shell Programming and Scripting

Inserting 2 columns from a file to another with nawk

Hello all, I have these 2 files File1 123 100 456 200 789 300 File2 |1|2|3||4|5||6| |1|2|3||4|5||6| |1|2|3||4|5||6| I need an output like : |1|2|3|123|4|5|100|6| |1|2|3|456|4|5|200|6| |1|2|3|789|4|5|300|6| (3 Replies)
Discussion started by: rany1
3 Replies

6. Red Hat

cannot set user id: Resource temporarily unavailable (not open file/open process related)

First post, sorry to be a bother but this one has been dogging me. I have a process user (java application server) that trips a resource limit every couple weeks and need help finding what limit we're hitting. First, this is what's running: This is the error when jobs are run or the... (0 Replies)
Discussion started by: Katahdin
0 Replies

7. Shell Programming and Scripting

Add a column to a file with nawk

Hi all, I'm new at forum, I cant find an answer to my problem so , I need a file which has pipe as a file separator and I need to add a column to a file in the third column I write this code but it s not enough , cat allproblems | nawk'\ BEGIN { FS:"|" } {print $3 $4 $5, ????} ' ... (7 Replies)
Discussion started by: circuitman06
7 Replies

8. Shell Programming and Scripting

how to access values of awk/nawk variables outside the awk/nawk block?

i'm new to shell scripting and have a problem please help me in the script i have a nawk block which has a variable count nawk{ . . . count=count+1 print count } now i want to access the value of the count variable outside the awk block,like.. s=`expr count / m` (m is... (5 Replies)
Discussion started by: saniya
5 Replies

9. UNIX for Advanced & Expert Users

nawk - file limits

Hi, I want to search particular pattern and splitting the file in to multiple files. (Splitted files may be more than 150). It got splitted upto 20 files after that, I got some error. nawk: filename.21 makes too many open files. input record number 654, file xxxxxxx Can u guide me to... (1 Reply)
Discussion started by: sharif
1 Replies

10. Shell Programming and Scripting

append field to file(nawk)

I have two files. File A and File B. File A has two fields separated by comma 352020252365988, 652020100572356 546876543215667, 652065465654686 ... File B has many Fields separate by spaces Date Name 352020252365988 Reference Date2 Name2 546876543215667 Reference I want to... (4 Replies)
Discussion started by: axl
4 Replies
Login or Register to Ask a Question