inplace-editing

Save modifications in place with NON GNU awk

爱⌒轻易说出口 提交于 2021-01-21 14:23:30
问题 I have come across a question(on SO itself) where OP has to do edit and save operation into Input_file(s) itself. I know for a single Input_file we could do following: awk '{print "test here..new line for saving.."}' Input_file > temp && mv temp Input_file Now lets say we need to make changes in same kind of format of files(assume .txt here). What I have tried/thought for this problem: Its approach is going through a for loop of .txt files and calling single awk is a painful and NOT

Save modifications in place with NON GNU awk

南笙酒味 提交于 2021-01-21 14:21:40
问题 I have come across a question(on SO itself) where OP has to do edit and save operation into Input_file(s) itself. I know for a single Input_file we could do following: awk '{print "test here..new line for saving.."}' Input_file > temp && mv temp Input_file Now lets say we need to make changes in same kind of format of files(assume .txt here). What I have tried/thought for this problem: Its approach is going through a for loop of .txt files and calling single awk is a painful and NOT

Primefaces p:inplace: How to more elegantly propagate the EL expression for entity to merge

只愿长相守 提交于 2020-01-11 04:11:05
问题 I would like to share the following powerful "hack" for getting at an entity whose value as been edited using p:inplace. My question is about how to achieve this more elegantly using other existing attributes of p:inplace or otherwise. The trick is adapted from a suggestion by BalusC on Stackoverflow: JSF (and PrimeFaces) How to pass parameter to a method in ManagedBean The question there involves getting at an Employee object that has a p:inplace edited #{emp.firstName}: <h:outputText value=

sed -i command for in-place editing to work with both GNU sed and BSD/OSX

耗尽温柔 提交于 2019-12-17 04:47:51
问题 I've got a makefile (developed for gmake on Linux) that I'm attempting to port to MacOS, but it seems like sed doesn't want to cooperate. What I do is use GCC to autogenerate dependency files, and then tweak them a bit using sed . The relevant portion of the makefile : $(OBJ_DIR)/%.d: $(SRC_DIR)/%.cpp $(CPPC) -MM -MD $< -o $@ sed -i 's|\(.*\)\.o:|$(OBJ_DIR)/\1.o $(OBJ_DIR)/\1.d $(TEST_OBJ_DIR)/\1_utest.o:|' $@ While this runs with no trouble under GNU/Linux, I get errors like the following

Problem with jQuery edit-in-place with live() function.. need a ninja

瘦欲@ 提交于 2019-12-11 08:58:36
问题 This is probably an easy fix, but I am having trouble wrapping my brain around it... I'm using a jQuery edit-in-place plugin for some divs that will be generated on the fly. It should be simple: Click in the newly created div, and be able to edit the contents. I'm running into problems with live(). Without using live(), it obviously works fine for a static div. Click once, get editable contents. While using live(), however, I need to double click in order to edit the contents. Then any

Parentheses over selected words in Eclipse

两盒软妹~` 提交于 2019-12-10 16:36:38
问题 A few days back I felt this question to be dumb and dint post it here, but after even after searching a lot I dint find a proper solution. For those of you who used TextEdit (on Mac), they will perfectly know what I am talking about. While coding I just want to put quotes or parentheses over a word or a line.To do this I'll have to move back to the starting of the word, open the quote and then go to the ending of the word and close it. Is there a plugin or so in eclipse where I can just

Primefaces p:inplace: How to more elegantly propagate the EL expression for entity to merge

主宰稳场 提交于 2019-12-01 01:28:10
I would like to share the following powerful "hack" for getting at an entity whose value as been edited using p:inplace. My question is about how to achieve this more elegantly using other existing attributes of p:inplace or otherwise. The trick is adapted from a suggestion by BalusC on Stackoverflow: JSF (and PrimeFaces) How to pass parameter to a method in ManagedBean The question there involves getting at an Employee object that has a p:inplace edited #{emp.firstName}: <h:outputText value="First name:"/> <p:inplace id="firstname" editor="true"> <p:ajax event="save" onsuccess="#

How to enable in-place editing in an asp:GridView?

。_饼干妹妹 提交于 2019-11-30 17:08:17
问题 How can i add edit boxes, and read their values during submit, with an asp:Repeater ? i have an asp:GridView which is displaying a read-only (i.e. non-editable) set of data, e.g.: How can i enabled the cells of the GridView to be editable, e.g (Photoshop Mockup): Note: i didn't mockup in Photoshop an edit box into every row and column (cause it was taking too long). You still get the idea. How can i convince an asp:GridView to show an edit-box in each cell? If i do convince the asp:GridView

sed command with -i option (in-place editing) works fine on Ubuntu but not Mac [duplicate]

荒凉一梦 提交于 2019-11-27 18:03:56
This question already has an answer here: I need my sed -i command for in-place editing to work with both GNU sed and BSD/OSX sed 7 answers I know nothing about Sed but need this command (which works fine on Ubuntu) to work on a Mac OSX: sed -i "/ $domain .*#drupalpro/d" /etc/hosts I'm getting: sed: 1: "/etc/hosts": extra characters at the end of h command Ubuntu ships with GNU sed , where the suffix for the -i option is optional. OS X ships with BSD sed , where the suffix is mandatory. Try sed -i '' To complement microtherion's helpful, to-the-point answer : with a portable solution with

shell script replace variables in file - error with Sed's -i option for in-place updating

China☆狼群 提交于 2019-11-27 15:51:44
Here is my test.env RABBITMQ_HOST=127.0.0.1 RABBITMQ_PASS=1234 And I want to use test.sh to replace the value in test.env to : RABBITMQ_HOST=rabbitmq1 RABBITMQ_PASS=12345 here is my test.sh #!/bin/bash echo "hello world" RABBITMQ_HOST=rabbitmq1 RABBITMQ_PASS=12345 Deploy_path="./config/test.env" sed -i 's/RABBITMQ_HOST=.*/RABBITMQ_HOST='$RABBITMQ_HOST'/' $Deploy_path sed -i 's/RABBITMQ_PASS=.*/RABBITMQ_PASS='$RABBITMQ_HOST'/' $Deploy_path But I have error sed: 1: "./config/test.env": invalid command code . sed: 1: "./config/test.env": invalid command code . How can I fix it? tl;dr : With BSD