The UNIX and Linux Forums  

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
call shell script from perl cgi script problem raksha.s Shell Programming and Scripting 2 03-25-2009 04:50 AM
ssh script problem problem pcjandyala Shell Programming and Scripting 2 07-31-2008 04:27 PM
Problem with csh script rahulrathod Shell Programming and Scripting 4 02-21-2008 12:38 PM
I don't think this would be a problem to script but ... CapnJuan UNIX for Dummies Questions & Answers 0 10-18-2006 06:06 PM
Problem starting a script from a 'main'-script Rakker UNIX for Dummies Questions & Answers 3 06-28-2005 09:12 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 03-31-2009
dsdev_123 dsdev_123 is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 26
script problem

Hello

I am trying to execute the following script

#!/bin/ksh
ABC=/abc/def/ghi/jkl/mna/opq/input
cd $ABC
Filename=`ls -t $ABC | tail -1`;
echo $Filename
awk 'NR == 1 || substr($0,63,5) ~ /H... / && \
_++ == 1 { fn && close(fn); fn = "$Filename_" ++c; _ = 1 }
{ print > fn }' $Filename

i need to split the file based on certain condition. I want the splitted files with the naming convention as of input filename appended by _1,_2.. etc.

When i am trying to execute the above script fn is not getting assigned to input filename and i am getting the file names as below
$Filename_1
$Filename_2.....

Please help me
Thanks
 

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 07:27 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