The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
shell script to remove old files and write to a log file yabai Shell Programming and Scripting 4 12-09-2008 01:08 PM
write new line at the beginning of an existing file sailussr UNIX for Dummies Questions & Answers 5 11-06-2008 05:42 PM
shell script that adds two integers and display answer on screen wanyac2 Shell Programming and Scripting 1 07-04-2008 09:37 AM
Shell scripting book adds excellent reference to your library - Linux PR (press relea iBot UNIX and Linux RSS News 0 07-12-2007 04:40 PM
How to write Flat Files by shell script using Oracle Database coolbuddy UNIX for Advanced & Expert Users 3 02-21-2006 02:50 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-16-2008
amitpansuria amitpansuria is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 91
how to write shell scrit which adds parameters to existing files

Helo I have one file in that one filed is there

RECLEN: 5

now I want to write a shell script which incresaes the value of RECLEN by 126
as well as I want to write shell script which adds
CURPHONER:2:N:Phone used to call a record on which a recall is set
PHONECNTR:2:N:Number of attemmpts at calling RECALLNUMBER to the existing files

how to write such shell scripts

Regards,
Amit
  #2 (permalink)  
Old 11-16-2008
amitpansuria amitpansuria is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 91
Quote:
Originally Posted by amitpansuria View Post
Helo I have one file in that one filed is there

RECLEN: 5

now I want to write a shell script which incresaes the value of RECLEN by 126
as well as I want to write shell script which adds
CURPHONER:2:N:Phone used to call a record on which a recall is set
PHONECNTR:2:N:Number of attemmpts at calling RECALLNUMBER to the existing files

how to write such shell scripts

Regards,
Amit
Helo I want to change my problem statement little.

CURPHONER:2:N:Phone used to call a record on which a recall is set
PHONECNTR:2:N:Number of attemmpts at calling RECALLNUMBER to the
to the existing files file1,file2 in one sort and
as well as I want to write a shell script which incresaes the value of RECLEN by 126.

e.g. I have two list1.fdict ,list2.fdict

when I do in my script


echo "CURPHONER:2:N:Phone used to call a record on which a recall is set" >> /opt/avaya/pds/amit/*.fdict

I got following error:

line 5: /opt/avaya/pds/amit/*.fdict: ambiguous redirect

what to do

Regards,
Amit
  #3 (permalink)  
Old 11-16-2008
Franklin52 Franklin52 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,293
You can't redirect the line to a selection of files this way. Loop through the files like this:

Code:
for file in /opt/avaya/pds/amit/*.fdict; do
  echo "CURPHONER:2:N:Phone used to call a record on which a recall is set" >> $"file"
done
Regards
  #4 (permalink)  
Old 11-17-2008
amitpansuria amitpansuria is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 91
Quote:
Originally Posted by Franklin52 View Post
You can't redirect the line to a selection of files this way. Loop through the files like this:

Code:
for file in /opt/avaya/pds/amit/*.fdict; do
  echo "CURPHONER:2:N:Phone used to call a record on which a recall is set" >> $"file"
done
Regards
thx for your reply.
Now I want to following lines to .fdict file . also if this line already exist then dont want to add. tell me how to write such effiecient script
CURPHONER:2:N:Phone used to call a record on which a recall is set
PHONECNTR:2:N:Number of attemmpts at calling RECALLNUMBER
PHONESTATR:1:C:PHONESTAT of the current RECALLNUMBER
ZONEPHONER:1:C:Time zone of the current RECALLNUMBER
LASTDATER:10ate of last attempt on RECALLNUMBER
LASTTIMER:8:T:Time of last attempt on RECALLNUMBER
LASTSTATR:2:C:Stat of last attempt on RECALLNUMBER
FRSTDATER:10ate of first attempt to call RECALLNUMBER
FRSTTIMER:8:T:Time of first attempt to call RECALLNUMBER
FRSTSTATR:2:C:Stat of first attempt to call RECALLNUMBER
SCNDDATER:10ate of second attempt to call RECALLNUMBER
SCNDTIMER:8:T:Time of second attempt to call RECALLNUMBER
SCNDSTATR:2:C:Stat of second attempt to call RECALLNUMBER
THRDDATER:10ate of third attempt to call RECALLNUMBER
THRDTIMER:8:T:Time of third attempt to call RECALLNUMBER
THRDSTATR:2:C:Stat of third attempt to call RECALLNUMBER
FRTHDATER:10ate of fourth attempt to call RECALLNUMBER



Regards,
Amit
Closed Thread

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 03:08 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