Add message in a command line processing


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Add message in a command line processing
# 1  
Old 11-17-2010
Add message in a command line processing

I am trying to add a message while archive some files.

For example I am using the below command to archive some files
Code:
tar -cvf inst.tar Linux

The command gives the terminal display like as below
Quote:
a Linux/ 0K
a Linux/libconfig.so 4192K
a Linux/libconfig64.so 3238K
a Linux/tar 965K
I want to add a message beginning of each line followed by orginal message and end message. Like as
Quote:
Processing [Orginal Info] ...
Quote:
Processing a Linux/ 0K ...
Processing a Linux/libconfig.so 4192K ...
Processing a Linux/libconfig64.so 3238K ...
Processing a Linux/tar 965K ....
Is there any way to display information using command line ?

Thanks
# 2  
Old 11-17-2010
Code:
 
tar -cvf inst.tar Linux | awk '{ print "Processing "$0 " My End info"}'


Last edited by panyam; 11-17-2010 at 09:26 AM..
This User Gave Thanks to panyam For This Post:
# 3  
Old 11-17-2010
Hi Panyam,Thanks for your swift response. The above command add the message at beginning of the line only. How add a message at end of the statment.
Quote:
Processing [terminal display] My end info
# 4  
Old 11-17-2010
Quote:
Originally Posted by k_manimuthu
Hi Panyam,Thanks for your swift response. The above command add the message at beginning of the line only. How add a message at end of the statment.
Updated my previous statement,pls have a look.
This User Gave Thanks to panyam For This Post:
# 5  
Old 11-17-2010
thanks a lot
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Add command line argument

I would like to add the ability to change the message that is displayed when timer is finished. At present it just asks for the time I want for the alarm. I think what I need is another command line argument. soundfile="/usr/share/sounds/My_Sounds/Alarm-sound-buzzer.mp3"... (5 Replies)
Discussion started by: drew77
5 Replies

2. Shell Programming and Scripting

Processing Multiple Arguments in Command Line Options

Hi All, I am new to scripting. Could you please assist me . Here is my requirement. I have written a script that has 2 option flags defined. -l) calls some function with the arguments passed in front of -l -r) calls second function with the arguments passed in front of -r *) calls the... (7 Replies)
Discussion started by: Jay Deshpande
7 Replies

3. Shell Programming and Scripting

How to add line number using UNIX command?

Hi, I am working on Shell script and I have a .dat file in which I want to add line numbers. Please see below example file Input File: 19523479811841494432C2013052700000000 19523479811730333980A2013052700000000 19523479811417044397I2013052700000000 19523479811205895810A2013052700000000... (7 Replies)
Discussion started by: jnrohit2k
7 Replies

4. Shell Programming and Scripting

Command line: add text wrapper around words

I am trying to build a sinkhole for BIND. I created a master zone file for malicious domains and created a separate conf file, but I am stuck. I have a list of known bd domains that is updated nightly. The file simply contains the list of domains, one on each line: Bad.com Bad2.com... (4 Replies)
Discussion started by: uuallan
4 Replies

5. Shell Programming and Scripting

[awk] line by line processing the same file

Hey, not too good at this, so I only managed a clumsy and SLOW solution to my problem that needs a drastic speed up. Any ideas how I write the following in awk only? Code is supposed to do... For every line read column values $6, $7, $8 and do a calculation with the same column values of every... (6 Replies)
Discussion started by: origamisven
6 Replies

6. Shell Programming and Scripting

reading a file inside awk and processing line by line

Hi Sorry to multipost. I am opening the new thread because the earlier threads head was misleading to my current doubt. and i am stuck. list=`cat /u/Test/programs`; psg "ServTest" | awk -v listawk=$list '{ cmd_name=($5 ~ /^/)? $9:$8 for(pgmname in listawk) ... (6 Replies)
Discussion started by: Anteus
6 Replies

7. Shell Programming and Scripting

Reading a file line by line and processing for each line

Hi, I am a beginner in shell scripting. I have written the following script, which is supposed to process the while loop for each line in the sid_home.txt file. But I'm getting the 'end of file' unexpected for the last line. The file sid_home.txt gets generated as expected, but the script... (6 Replies)
Discussion started by: sagarparadkar
6 Replies

8. UNIX for Dummies Questions & Answers

Add line command

What command should I use to add a line after a text? I don't want to do it in vi. echo ra > na echo ras >> na when I type cat na, it displays ra ras How can I display it: ra ras With a line in between without using any text editor (3 Replies)
Discussion started by: felixwhoals
3 Replies

9. Shell Programming and Scripting

Command to add 1000 spaces to end of line

hi, could anyone tell me the command to append spaces at the end of the line. for example, i need 1000 spaces after the word "helloworld" echo "helloworld " i need to achieve this in someother way hardcoding 1000 spaces is not practical. as i am totally new... (3 Replies)
Discussion started by: kavithacs
3 Replies

10. UNIX for Dummies Questions & Answers

add data from command line to end of file

how can I add data from command line to end of file? (3 Replies)
Discussion started by: bryan
3 Replies
Login or Register to Ask a Question