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
Errors-- Any Idea jazz21 Shell Programming and Scripting 3 10-18-2007 02:11 PM
any good idea on this? fedora Shell Programming and Scripting 7 09-29-2006 03:36 PM
Limitations of awk? Good idea? Bad idea? yongho Shell Programming and Scripting 2 06-08-2005 05:18 PM
An Idea for Tokenizing neked Shell Programming and Scripting 8 06-08-2005 02:43 AM

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 03-04-2008
dakid dakid is offline
Registered User
  
 

Join Date: May 2006
Posts: 27
help... no idea what to use

my issue now is i have a txt file containing a list like below

Quote:
0006EME0JRWUWOFQ
0006EME0JRWUWOIC
0006EME0JRWUWOM9
0006EME0JRWUWOQ5
0006EME0JRWUWP0Z
0006EME0JRWUWP72
0006EME0JRWUWPBE
0006EME0JRWUWPFB
0006EME0JRWUWPKI
0006EME0JRWUWPPA
0006EME0JRWUWQ3L
0006EME0JRWWKRLV
0006EME0JRWWKRQ7
0006EME0JRWWKS2C
0006EME0JRWWKS4X
i want to create a script that will add a constant text "Find this name" at the start and "at your directory" at the end. every line should be added by phrase at the start and end.

Each line of the file should look like "Find this name 0006EME0JRWWKS4X at your directory"
thanks
  #2 (permalink)  
Old 03-04-2008
apsprabhu apsprabhu is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 43
hi,

the below script will adress your requirement,


for text in
do
line=`echo -e "Find this name $text at your directory"`
echo $line >> output_file
done < input_file
  #3 (permalink)  
Old 03-04-2008
Klashxx's Avatar
Klashxx Klashxx is offline Forum Advisor  
HP-UX/Linux/Oracle
  
 

Join Date: Feb 2006
Location: Almerķa, Spain
Posts: 393
Simply:
Code:
awk '{print "Find this name "$1"  at your directory" }' file
  #4 (permalink)  
Old 03-04-2008
chella chella is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 75
Using sed:

Code:
sed 's/^/Find this name /g;s/$/ at your directory/g' file
Regards
Chella
  #5 (permalink)  
Old 03-06-2008
aajan aajan is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 80
cat filename | while read line
do
echo "Find this name $line at your directory"
done
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 08:45 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