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



How to add some content in any file at some desired location without using VI or some other editor..

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

How to add some content in any file at some desired location without using VI or some other editor..

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

Post New Answer

More Shell Script Interview Questions

What is the need of including script interpreter in your shell script?

2 Answers  


shell script for reverse the string

0 Answers  


Explain how you Automate your application using Shell scripting.

0 Answers   MAHINDRA,


What is the meaning of $1 in shell script?

0 Answers  


What is an sh file?

0 Answers  






write a shell script to check whether all the directories in the path exist has read and write permission

1 Answers  


What is a program shell?

0 Answers  


Write a command sequence to find all the files modified in less than 2 days and print the record count of each.

0 Answers  


1.Write a script, which converts a number from binary to hexadecimal format or vice versa.

1 Answers   ADP,


How do we delete all blank lines in a file?

0 Answers  


What is the fastest scripting language?

0 Answers  


In my bash shell I want my prompt to be of format '$"present working directory":"hostname"> and load a file containing a list of user-defined functions as soon as I log in, how will you automate this?

0 Answers  


Categories