|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Typecasting problem??
Code:
but when i run this command Code:
I get below o/p Code:
file content is Code:
required o/p is Code:
|
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
Try this Code:
sed -i "s/\$/ ,$verbiage/" noverb.F5 |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Hi vikram
I tried ur command, but it aint working, its just givin me the o/p of verbiage Code:
|
|
#4
|
|||
|
|||
|
Code:
cat vikram13.sh 23470330,s2ZsUMmoMCdllhIdZSWxdBl7cH0=,S40,1.6.52,MTN 2398774,s2ZsUMmoMCdllhIdZSWxdBl7cH0=,S40,1.6.52,MTN 2379162,pSSDGuUiPRX5c2MQUaBKYjvzOwg=,S30,4.0,MTN Code:
vi vikram14.sh
#!/bin/sh
verbiage=('"Nigeria","Can Nigeria succeed in their quest for a top 4 finish? Get daily Nigeria news, GOALS and LIVE Match updates for 30days at N200.Click Accept to SUBSCRIBE"')
echo $verbiage
sed -i "s/\$/, $verbiage/" vikram13.shAfter running the script Code:
vikram14.sh Code:
cat vikram13.sh 23470330,s2ZsUMmoMCdllhIdZSWxdBl7cH0=,S40,1.6.52,MTN, "Nigeria","Can Nigeria succeed in their quest for a top 4 finish? Get daily Nigeria news, GOALS and LIVE Match updates for 30days at N200.Click Accept to SUBSCRIBE" 2398774,s2ZsUMmoMCdllhIdZSWxdBl7cH0=,S40,1.6.52,MTN, "Nigeria","Can Nigeria succeed in their quest for a top 4 finish? Get daily Nigeria news, GOALS and LIVE Match updates for 30days at N200.Click Accept to SUBSCRIBE" 2379162,pSSDGuUiPRX5c2MQUaBKYjvzOwg=,S30,4.0,MTN, "Nigeria","Can Nigeria succeed in their quest for a top 4 finish? Get daily Nigeria news, GOALS and LIVE Match updates for 30days at N200.Click Accept to SUBSCRIBE" |
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
Vikram
when i'm running inside the script m gettin the same o/p as mentiond previously Code:
|
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
I'd bet your file has windows control chars in it, at least a
<CR> at the end. Get rid of those and it will fly.
And, in the regex, you don't need the \ in front of the $ sign representing the line end... |
| The Following User Says Thank You to RudiC For This Useful Post: | ||
nikhil jain (02-21-2013) | ||
| Sponsored Links | |
|
|
#7
|
|||
|
|||
|
Hello Rudic, Thanks for correcting me. Code:
\ not required in front of Code:
$ in regex .
|
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| C Programming.. Typecasting of structure pointers.. | Priya Amaresh | Programming | 3 | 08-31-2012 04:32 AM |
| Problem with forwarding emails (SPF problem) | carwe | IP Networking | 0 | 08-16-2011 06:17 AM |
| user login problem & Files listing problem. | pernasivam | AIX | 1 | 06-18-2009 09:09 AM |
| ssh script problem problem | pcjandyala | Shell Programming and Scripting | 2 | 07-31-2008 03:27 PM |
| problem with dd command or maybe AFS problem | Anta | Shell Programming and Scripting | 0 | 08-25-2006 10:10 AM |
|
|