![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Script to capture new lines in a file and copy it to new file | fara_aris | Shell Programming and Scripting | 0 | 05-27-2008 11:11 PM |
| capture ping to a file | MizzGail | SUN Solaris | 3 | 09-20-2007 10:31 AM |
| Capture Value from file | kris01752 | UNIX for Advanced & Expert Users | 1 | 08-28-2006 11:50 PM |
| Capture the command run in the log file | ahmedwaseem2000 | Shell Programming and Scripting | 4 | 08-09-2006 02:06 PM |
| capture nohup log file | mgirinath | Shell Programming and Scripting | 2 | 04-24-2006 05:51 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
capture the file name
I am trying to capture the file name(which is not of fixed length) and put it in a variable. It is working in unix whereas when I am running the same script in Informatica it is not giving me the desired output. But when I comment the option(find the file name) then it is working fine. It can also because I am using awk. Is there any other way(other than using awk) to find the file name? File name will be in second line of the file with 2 other items filesize numeric(10) and record count numeric(8).
Here is my code: #!/bin/ksh eval $(awk 'NR==2 { printf "header_fname=\"%s\"\n", substr($0,1,length-18) ## filename }' $1) echo "$header_fname" Sample file: id_xyz20070523085554004 abcdefgh.csv000000324100000036 |
|
|||||
|
Quote:
Jean-Pierre. |
![]() |
| Bookmarks |
| Tags |
| bash, bash eval, eval |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|