unix shell programm(need urgent Help)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting unix shell programm(need urgent Help)
# 1  
Old 06-29-2011
unix shell programm(need urgent Help)

Hi guys,
i am new to shell can u please explain how to get those two outputs
in temp1

i have i/p like
Code:
abcd 
edk
lkg 
jkl
loop

i need o/p
Code:
abcd *********
edk**********
lkg ***********
jkl ***********
loop************

need o/p
Code:
abcd 
***************
edk
***************
lkg 
***************
jkl
****************
loop
***************

can u please tell me script and please explain syntax also how its wrks


thanks in advance

Last edited by Franklin52; 06-29-2011 at 04:41 AM.. Reason: Please use code tags for code and data samples, thank you
# 2  
Old 06-29-2011
Code:
% cat >testfile
abcd 
edk
lkg 
jkl
loop
app@kf3sv ~/tmp 
% sed -r 's/$/*****************/; s/^(.{14}).*$/\1/' testfile
abcd *********
edk***********
lkg **********
jkl***********
loop**********
app@kf3sv ~/tmp 
% sed -r 's/$/\n*****************/' testfile
abcd 
*****************
edk
*****************
lkg 
*****************
jkl
*****************
loop
*****************

And no, I couldn't explain better then in many web tutorials about sed.
And you really have spaces after "abcd" and "lkg" in your example.

Last edited by yazu; 06-29-2011 at 04:28 AM..
# 3  
Old 06-29-2011
tnx ..its working Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

URGENT Reading a file and assessing the syntax shell script URGENT

I am trying to write a shell script which takes an input file as an arguement in the terminal e.g. bash shellscriptname.sh input.txt. I would like for the file to be read line by line each time checking if the .txt file contains certain words or letters(validating the syntax). If the line being... (1 Reply)
Discussion started by: Gurdza32
1 Replies

2. Shell Programming and Scripting

Request to checkVenn diagram issue solve by Unix programm

Hello Any Unix programm can help me to solve thsi issue: I have 2 venn digrams please checke the attached file for pictures of venn diagram for eg red is A yellow is B and green is C..Please see attached file for Venn diagrams In one ..... I have 3 data set A , B and C Venn diagram... (0 Replies)
Discussion started by: manigrover
0 Replies

3. Shell Programming and Scripting

(Urgent):Creating flat file using sql script and sqlplus from UNIX Shell Script

Hi, I need help urgently for following issue. Pls help me to resolve this issue. I am calling sql script file(file1.sql) from UNIX Shell Script(script1.ksh) using sql plus and trying to create flat file that contains all records returned from SQL query in SQL script(file1.sql) I given... (6 Replies)
Discussion started by: praka
6 Replies

4. Shell Programming and Scripting

Running a Java Programm with a (korn)shell-script

hey everyone, For my studies i had to write a javaprogram which reads 2 integers from the keyboard and then using the basic operations(addition, division etc) with them. so far no problem. but now i gotta make a shell-script which: runs the program(compiled with javac) #!bin/ksh java... (1 Reply)
Discussion started by: simlmf
1 Replies

5. Shell Programming and Scripting

How to embeded programm within programm

Hi, How to embeded programme within perl programme. Shankarao (2 Replies)
Discussion started by: shankarao
2 Replies

6. Programming

how do i run am encrpyrtic programm on unix

how do i run am encrpyrtic programm on unix, (4 Replies)
Discussion started by: ghoz
4 Replies

7. Programming

How to programm TTY devices under UNIX platform?

Dear Export, I want to begin an serial-communication application codes associated with TTY devices. But I don't know what key settings should be concerned after opening a TTY device file under UNIX plarform(SunOS 5.7)? Could you give me some adivce? Thanks! (8 Replies)
Discussion started by: WayneYang
8 Replies

8. UNIX for Dummies Questions & Answers

UNIX problem? Unix programm runs windows 2000 CPU over 100%

Okee problems...!! What is happening: Unix server with some programms, workstations are windows 2000, the workstations work good but when you start a programm on the Unix server the CPU of the workstations go to 100% usage resulting that the system gets very slow. The programm well its running so... (2 Replies)
Discussion started by: zerocool
2 Replies

9. UNIX for Dummies Questions & Answers

how can i install a programm?

Hello Friends, I have a problem with install.Can u tell me,how can i install a program?I am not a Root.n i use AIX(IBM) system.n how can i access a cdrom?I have been tried it,but didn't work.I can'n mounted(can u tell me another way or Command)? thanks all. (3 Replies)
Discussion started by: Christianto
3 Replies

10. UNIX for Dummies Questions & Answers

How can install a programm?

Hello Friends, I have a problem with install.can u tell me how can I install a programm?I use AIX(IBM) system. And how can i access cd-rom?I can't mounted,coz i am not Root.(can u tell me another Command /way)? Thanks all. (1 Reply)
Discussion started by: Christianto
1 Replies
Login or Register to Ask a Question