How to add some content in any file at some desired location
without using VI or some other editor in UNIX
Answers were Sorted based on User's Feedback
Answer / tony
A one line piece of text can always be added like this:
$ echo "Please add this text" >> file.txt
A file (a text file preferably) can be added:
$ cat inputfile.txt >> outputfile.txt
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sujitha
We can use "Cat" command same as to work like VI to create
and save a file
example : cat>filename
Hi { we can enter content }
Hello
----
------
(ctrl+c) - It will Save in a file
| Is This Answer Correct ? | 0 Yes | 0 No |
What does echo mean in scripting?
Explain how you Automate your application using Shell scripting.
How to replace following lines, catch (DAOException e) { objLogger.error(this.getClass () + "addUpdateIssues() " + e); throw new BOException(5122); } catch (BOException e) { objLogger.error(this.getClass () + "addUpdateIssues() " + e); throw e; } catch (Exception e) { objLogger.error(this.getClass () + "addUpdateIssues() " + e); throw new BOException(5122); } Needs to be changed in to, catch (DAOException e) { AppException.handleException (null, null, e, null, null, null, "BOException", this.getClass() + "addUpdateIssues() ", null, null, null, null, null, null, null, null, 5122); } catch (BOException e) { AppException.handleException (null, null, null, e, null, null, "BOException", this.getClass() + "addUpdateIssues() ", null, null, null, null, null, null, null, null, 0); } catch (Exception e) { AppException.handleException (null, null, null, null, null, e, "BOException", this.getClass() + "addUpdateIssues() ", null, null, null, null, null, null, null, null, 5122); }
Why are shell scripts used?
How to find duplicate record in file using shell script?
0 Answers IBM, Saama Tech, Wipro,
Is shell scripting easy to learn?
Can we run shell script in windows?
What does echo $0 do?
What are script files?
What is awk in shell script?
How to find all the files modified in less than 3 days and save the record in a text file?
I have 2 files and I want to print the records which are common to both.