Help with escape in code


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with escape in code
# 1  
Old 08-19-2017
Help with escape in code

i want to add the code below to the end of every line in file4
im using this awk command to do this

Code:
awk '{print $0"txt-to-print-here"}' file4

its not working because i think i need to escape the code
please can someone show the right way
thanks



Code:
 | sed 's~http[s]*:/https:///~~g' > file1 ;grep -o 'https://ed[^?]*' file1 > file2 ;awk '0==x[$1 FS $2]++' FS="," file2 > file3 ;sed 's/playlist.m3u8/chunklist_w2053889821_b1148000.m3u8/g' file3 > file4

# 2  
Old 08-19-2017
Quote:
Originally Posted by bob123
i want to add the code below to the end of every line in file4
im using this awk command to do this
Code:
awk '{print $0"txt-to-print-here"}' file4

its not working because i think i need to escape the code
please can someone show the right way
thanks
Code:
 | sed 's~http[s]*:/https:///~~g' > file1 ;grep -o 'https://ed[^?]*' file1 > file2 ;awk '0==x[$1 FS $2]++' FS="," file2 > file3 ;sed 's/playlist.m3u8/chunklist_w2053889821_b1148000.m3u8/g' file3 > file4

Hello bob123,

If you are asking about the awk command then I don't think so you need not escape anything there, because you have used double quote" so it shouldn't be an issue.
Now coming onto your command, I am pretty sure that could be written in more easy way if you could show us the sample Input_file and expected output too, let us know on same.

Thanks,
R. Singh
# 3  
Old 08-19-2017
hi
RavinderSingh13

thanks for reply
the code works fine as it is

i just want to add that code to the end of every line in another file
can anyone help
thanks


Moderator's Comments:
Mod Comment Posting "Does not work" without explanation does not help you or anyone. If a command does not work for you, please show the exact circumstances you used it, and the exact error or malfunction you received. Do not paraphrase errors, or post the text as links, images, or attachments if you can avoid it: Paste the exact message, in code tags, like [code] text [/code] or by selecting the text and using the Image button.

Thank you.

The UNIX and Linux Forums
# 4  
Old 08-19-2017
Please become accustomed to provide decent context info of your problem.

It is always helpful to support a request with system info like OS and shell, related environment (variables, options), preferred tools, adequate (representative) sample input and desired output data and the logics connecting the two, and, if existent, system (error) messages verbatim, to avoid ambiguities and keep people from guessing.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Escape Sequences

Hi Gurus, Escape sequences \n, \t, \b, \t, \033(1m are not working. I just practiced these escape sequences. It worked first. Later its not working. Also the command - echo inside the script editor shows as shaded by a color. Before that echo inside the script editor wont show like this.... (4 Replies)
Discussion started by: GaneshAnanth
4 Replies

2. Shell Programming and Scripting

Auto escape script to escape special chars in script args

This is a bit off the wall, but I often need to run scripts where there are argument values that contain special characters. For example, $ ./process.exe -t M -N -o temp.mol.s -i ../molfiles/N,N\',N\'\'-trimethylbis\(hexamethylene\)triamine.mol && sfile_space_to_tab.sh temp.mol.s temp.s It... (1 Reply)
Discussion started by: LMHmedchem
1 Replies

3. Shell Programming and Scripting

Escape characters

i am executing script from A server which will execute the script in B server , as below. ssh A 'ssh B echo 'select * from testing where name ='test'' i am getting the below output. select * from testing where name=test but i need the output where clause with quotes , tried with... (3 Replies)
Discussion started by: expert
3 Replies

4. Shell Programming and Scripting

Escape code problem again

Now theres another problem. I would like to output not just a colored block, but how would I output not a solid block character, but a shaded block instead? Please help. I'm writing a library for these codes and this would really help. (4 Replies)
Discussion started by: tinman47
4 Replies

5. Shell Programming and Scripting

Escape and combination

Hi I have 2 files like: file1 a 12 b 1 a 3 file2 a 9 c 0 a 8 and i would like to get a 12 a 9 a 3 a 8 i can do it with grep and paste with 3 lines. I tried to combine using: (3 Replies)
Discussion started by: Dedalus
3 Replies

6. Shell Programming and Scripting

Escape character

Hi , I want to change space to ' in my script. I tried doing this, sed 's/ /\'/g' filename but i could not get it. can some one help me please. Thanks, Deepak (4 Replies)
Discussion started by: deepakpv
4 Replies

7. Shell Programming and Scripting

escape characterz...

hey i wanted to know if there is some single unix command to replace all the character escape sequences with their "C" values in a string... The only way i know is repetatively kepp using the grep command for each one. (4 Replies)
Discussion started by: sahithi_khushi
4 Replies

8. Solaris

Available escape sequences

:) Hi, Can any one help me to find available escape sequences in UNIX shell programming? ( Like \n, \c etc,. in C or C++) Iam generating one report using one of the script, in that it is very much essential. Regards, LOVE (6 Replies)
Discussion started by: Love
6 Replies

9. Shell Programming and Scripting

Escape character in vi?

I want to replace a string which contains "/" in vi but what is the escape character for forward slash? e.g. I have a text file with the contents below and I want to replace "/Top/Sub/Sub1" with "ABC". /Top/Sub/Sub1 The replace command I am using is ... (4 Replies)
Discussion started by: stevefox
4 Replies

10. UNIX for Dummies Questions & Answers

escape codes

I did a search and found the link for escape codes,- but I am not sure how to modify this script to set the margins. I started with a script that was already written on my system to set a printer to print landscape. I need to send an report that is in an ascii file to multiple printers from my... (1 Reply)
Discussion started by: MizzGail
1 Replies
Login or Register to Ask a Question