Search Results

Search: Posts Made By: freegnu
3,226
Posted By freegnu
SunOS
Can you try it with the -e on SunOS?
3,226
Posted By freegnu
More straight forward: # echo...
More straight forward:

# echo 'asdasdada<cr>aasdsad<cr><cr>asdasdfsdfs<cr><cr><cr>asdsada<cr>adasd<cr>daasdaasd<cr><cr><cr>'|sed 's/\(<cr>\)\{1,\}/<cr>/g'

result:
...
1,056
Posted By freegnu
m/[[:alpha:]]{2}[[:digit:]]-[[:alpha:]]{2}[[:digit...
m/[[:alpha:]]{2}[[:digit:]]-[[:alpha:]]{2}[[:digit:]]/
1,186
Posted By freegnu
Use a quoted here documents
Use a quoted here document. Make sure you quote your identifier or the quotes will still give you problems.

You can tell when you have done it right because you don't have to type Ctrl-D after you...
1,745
Posted By freegnu
sed and awk shell script and command line examples
I noticed you didn't seem to get a response that addressed the case of the logical CSV line being broken over some number other than 3 lines.
The code I provide works with the logical CSV broken...
42,020
Posted By freegnu
awk '{if(NR==2)$2=100;print $0}' input ...
awk '{if(NR==2)$2=100;print $0}' input

---------- Post updated at 10:17 AM ---------- Previous update was at 10:16 AM ----------

Type 'man awk' and 'man bash' at the command line for complete...
42,020
Posted By freegnu
Need more info
Is the value you want to replace always the second value in the second row? Or is it the only nonzero value in the file? Do the files only have 3 rows?
42,020
Posted By freegnu
This does it all. Remove parts to do one or the...
This does it all. Remove parts to do one or the other.
awk '/^5/||(NR==2){for(i=1;i<=NF;i++)if($i=="x")$i="y";print $0};/^[^5]/&&(NR!=2)' input
7,172
Posted By freegnu
Use Automator on Mac OS X. Create a new...
Use Automator on Mac OS X. Create a new application not a workflow.

In Automator under utilities add a run shell script action and underneath it add a run applescript if you want to see your...
5,052
Posted By freegnu
This may be a GNU sed verses BSD sed problem
Try it with the triple quoted backslash to see if it works.
\\\\
instead of single quoted
\\
It would help if you showed the out put of what doesn't work. Including the output of the echo of $URL.
8,411
Posted By freegnu
explanation
printf print without a newline
NF?$0:"\n" a conditional expression.
test_condition ? true_result : false_result
NF return 0 for blank lines. Zero is considered false.
$0 returns the whole...
5,052
Posted By freegnu
How to deal with escaping in bash and sed
You can also simplify the URL variable assignment like so:
URL=`sed -ne '/client.url/{s/^.*=//,s%/%\\\\/%g,p}' temp.txt`
Explanation:
-n don't print lines by default
/client.url/ Act only on...
Showing results 1 to 12 of 12

 
All times are GMT -4. The time now is 01:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy