Shell Script problem with sed


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell Script problem with sed
# 1  
Old 07-29-2010
Shell Script problem with sed

Hello
i have a shell script which will go in some folders using for loop, build some programs with gcc and zip the output.
then i have to paste the file of that zip file into a yml file which will be further used by a ruby watir script.
Code:
PROJECT_PATH=/uploads/$PROJECT_FOLDER
zip -rq  /uploads/$PROJECT_FOLDER/build/Release-iphoneos/Apptitude.app.zip  /uploads/$PROJECT_FOLDER/build/Release-iphoneos/Apptitude.app
sed -ie 's|Bundle_Itunes_File_Binary: ""|Bundle_Itunes_File_Binary:  "/uploads/$PROJECT_FOLDER/build/Release-iphoneos/Apptitude.app.zip"|g'  submit_itunes_app.yml

but when i try to paste the path of zip file into that submit_itunes_app.yml it doesnt work..
it is always replaced by
Code:
Bundle_Itunes_File_Binary: "/uploads/$PROJECT_FOLDER/build/Release-iphoneos/Apptitude.app.zip"

Help me where i am going wrong.

also there are some files in this format
Bundle_Itunes_File_Large_1: "image_big121111.png"
nd i want to replace the file name with /path/to/directory/filename

Thanks in advance

---------- Post updated at 11:59 AM ---------- Previous update was at 10:50 AM ----------

Hi
This part is now solved
this thing worked
Code:
sed -ie 's|Bundle_Itunes_File_Binary: ""|Bundle_Itunes_File_Binary: "/uploads/'"$PROJECT_FOLDER"'/build/Release-iphoneos/Apptitude.app.zip"|g' submit_itunes_app.yml

Now how can i do this in the same file

Bundle_Itunes_File_Large_1: "image_big121111.png"

to

Bundle_Itunes_File_Large_1: "/path/to/directory/image_big121111.png"

for all the files.. as i have dozens of that.. greping each one and changing in all of them one by one will be a pain

Last edited by pludi; 07-29-2010 at 02:29 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed or awk script problem

Hi All I am having a file as shown below File1# modyle 1 { test jsj hhsjh 13e3 jsjjs } memP(dbg_trace) { ajjs jsjs jsjs Test(claer) { jsjs (7 Replies)
Discussion started by: kshitij
7 Replies

2. Shell Programming and Scripting

Shell quoting problem while editing a remote file using sed

value of i = solarisbox ssh $i "cat /etc/hosts | sed "s/$i\.local\.//" | sed "s/$i\./$i/" | sed "s/$i/$i.sol.com/" > /usr/users/chidori/edit_hosts"While running the above one liner its i am not able to make the changes and write it to the file /usr/users/chidori/edit_hosts . I know there is a... (2 Replies)
Discussion started by: chidori
2 Replies

3. Shell Programming and Scripting

Problem removing $ using sed in script

I am trying to use the sed command to remove any character that is passed as a parameter to the script. I may want to replace any character in the file (-, =, $, space). I'm running into an issue when passing the $. This is a typical row in the file. "000000B553","--INTERNAL USE... (6 Replies)
Discussion started by: nadneb
6 Replies

4. Shell Programming and Scripting

Sed Script Problem

My file is having the contents like this AND1 (A) { non : hafe on: tc ma : nite } AND1 (B) { non : hafe1 on: tc1 ma : nite1 } AND1 (C) { non : hafe3 on: tc2 ma : nite3 } I have written a sed script to search the patterns AND1(A) and AND1 (B) and delete the entire... (2 Replies)
Discussion started by: shalini_008
2 Replies

5. Shell Programming and Scripting

Problem using sed in script

Hey guys, I'm looking to write a script that takes a variable line number and prints that line via sed, but I'm having an issue with the syntax. As I understand it, the sed syntax to print line number 52 (for example) is as follows: sed -n '52p' sed '52!d' sed '52q;d' But how can you... (2 Replies)
Discussion started by: wandergeek
2 Replies

6. Shell Programming and Scripting

AIX Korn shell sed -s problem

In a Korn shell script I have, cat ../header | sed -e 's/flag1/$cnumb/g' > header.txt The header is short {{Company flag1}} But the result in header.txt is {{Company $cnumb}} The value of $cnumb is 120. I am trying to get the value of $cnumb into the header. I have tried /'$cnumb'/g,... (10 Replies)
Discussion started by: jcarrott
10 Replies

7. Shell Programming and Scripting

call shell script from perl cgi script problem

hi,, i have perl scipt with line : system('./try.sh $t $d $m'); in shell scipt try.sh i have the line: echo $1 its not printing value of $t that i hav passed..y is it so..i am running it from apache web server (2 Replies)
Discussion started by: raksha.s
2 Replies

8. Shell Programming and Scripting

shell script by sed

Hey everybody I need some help on how to order the data in file such as a file have first name last name and city and i would like to order them to in the same order by using sed thanks alot for your time (6 Replies)
Discussion started by: halola85
6 Replies

9. Shell Programming and Scripting

problem with sed command in shell script.

Guys, I've a problem in the "sed" command used in my shellscripts This is the problamatic line in my shell script: sed -e 's/${line1}/${line1_m}/g' prod_hier_1234.txt > test.txt It doesn't do the job of replacing the string stored in variable 'line1' to 'line1_m'. However If I replace the... (10 Replies)
Discussion started by: bhagat.singh-j
10 Replies

10. UNIX for Dummies Questions & Answers

sed modify problem in script

I am having problems with the following "sed" command only when it is issued within a bash script. #!/bin/bash cat config.xml | sed -e 's/yes/no/g' > newconfig.xml When I enter this command from the command line it works like a charm, but when run in a script as shown it "zero's out" my... (2 Replies)
Discussion started by: darthur
2 Replies
Login or Register to Ask a Question