0
sed -r -i -e "s/AppId/$a/" -e "s/AccessToken/$b/" FacebookApi > /script/newapp

By giving this command why the program is not getting executed can you solve this please ?

1
  • Remove -i or output redirection > /script/newapp. Commented Jun 19, 2015 at 5:16

2 Answers 2

1

sed is an editor, not a shell interpretor. It execute SED instruction like subistitute for s/// but not batch or binary of other form (than sed instruction). Execution stay at calling shell level and management (like variable substition between double quote in a sed instruction string that is treated before sed receive the full instruction)

Sign up to request clarification or add additional context in comments.

Comments

0

The command is executed. As you specified -i it is modifying the specified file in place (and not generating any output).

From the sed man page:

-i extension

Edit files in-place, saving backups with the specified extension.  If a zero-length extension is given, no backup will be saved.  It is not recommended to give a zero-length
extension when in-place editing files, as you risk corruption or partial content in situations where disk space is exhausted, etc.

As sed is directly modifying FacebookApi standard output will be empty (as the file /script/newapp)

3 Comments

yeah you are right am not getting the exact output it is empty.so how to modify it ?
actually i need to store the output in a new file
Do not use the -i option. If you specify "in place" sed will do the substitution "in place"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.