# On shell scripting

**URL:** <https://community.unix.com/t/on-shell-scripting/211985>\
**Category:** Shell Programming and Scripting\
**Created:** [September 10, 2008, 11:44am UTC](https://community.unix.com/t/on-shell-scripting/211985 "2008-09-10T11:44:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dreamer\_2580](https://community.unix.com/user_avatar/community.unix.com/dreamer_2580/32/4457_2.png) [@dreamer\_2580](https://community.unix.com/u/dreamer_2580)\
**Post date:** [September 10, 2008, 11:44am UTC](https://community.unix.com/t/on-shell-scripting/211985/1 "2008-09-10T11:44:25Z")

</div>

can somebody help me...

i wanted to change a certain OLD WORD with a NEW WORD in just a SPECIFIC LINE..

example..

Line No. Name Age ID Number  
1 Joan 14 2008-1521  
2 Mike 14 2008-1623  
3 Kyle 16 2007-1562

how will i PROMPT the user for the LINE NUMBER 1 and CHANGE the AGE??

please help me,,,😕😕

thank you very much

---

<div class="post-metadata">

**Author:** ![vidyadhar85](https://community.unix.com/user_avatar/community.unix.com/vidyadhar85/32/997_2.png) [@vidyadhar85](https://community.unix.com/u/vidyadhar85)\
**Post date:** [September 10, 2008, 11:50am UTC](https://community.unix.com/t/on-shell-scripting/211985/2 "2008-09-10T11:50:07Z")

</div>

> [@dreamer\_2580](#):
>
> can somebody help me...
> 
> i wanted to change a certain OLD WORD with a NEW WORD in just a SPECIFIC LINE..
> 
> example..
> 
> Line No. Name Age ID Number  
> 1 Joan 14 2008-1521  
> 2 Mike 14 2008-1623  
> 3 Kyle 16 2007-1562
> 
> how will i PROMPT the user for the LINE NUMBER 1 and CHANGE the AGE??
> 
> please help me,,,😕😕
> 
> thank you very much

seems like homework for me..  
i can give you an idea..  
first ask user for line no store it in variable  
then use sed or awk to get that line e.g sed -n '/$lineno/p'  
then ask user the age change store it in a variable then use awk to replace it with old one

---

<div class="post-metadata">

**Author:** ![dreamer\_2580](https://community.unix.com/user_avatar/community.unix.com/dreamer_2580/32/4457_2.png) [@dreamer\_2580](https://community.unix.com/u/dreamer_2580)\
**Post date:** [September 10, 2008, 12:21pm UTC](https://community.unix.com/t/on-shell-scripting/211985/3 "2008-09-10T12:21:17Z")

</div>

THANKS vidyadhar85 for your reply....

but im sad to say that im still confused..  
i have only a single file in storing my datas( RecordBook.data)  
now i wanted to change the Age of the Person listed in my RecordBook.data AS Record No. 2....  
how am i to solve this one...

i hope u would still continue to help me... thank a lot my dear friend...
