in unix echo is used for

Answer Posted / tubecharger

In unix, echo is used to display whatever is following it
onto the terminal or screen. Special characters get handled
differently and are processed by the shell with their
special meaning. If special characters are to be displayed
using echo, then they must be preceded by a back-slash or
put in quotes or double quotes or a combination of all of
these depending on what you are trying to do.
For example:
example 1:
echo hello world
displays
hello world

example 2:
echo "Hello there!"
displays
Hello there!
(and here the special character ! is quoted so that it's
special meaning is ignored.)

example 3:
set message = "this is a message."
echo $message
displays
this is a message.

echo on - by itself does not turn on and off echoing of
commands to the terminal. echo on simply types "on" at the
terminal.

echo string >> filename may work on some systems but the
conventional way of doing this is using the cat command:
cat "hello world" > filename

Refer to the man page on csh, bash or sh for more details on
the echo command.

Is This Answer Correct ?    20 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are awk commands?

582


Write a command that will allow a unix system to shut down in 15 minutes, after which it will perform a reboot.

620


What is “chmod” command?

564


When i run a programm of orphan process. Instead of getting child's parent (ppid)=1 ..i get 1400 and it varies as per system. How can i findthe right soluion??? My pgm: #include # include int main() { int pid; pid=fork(); if(pid < 0) {exit(-1);} else if(pid==0) { printf("Child Process is Sleeping ..."); sleep(10); printf("Orphan Child's Parent ID : %u ",getppid()); } else { printf("Parent Process Completed ... %u ",getpid()); exit(0); } return 0; } Output:

1758


How is the command '$cat file2 ' different from '$cat >file2 and >> redirection operators ?

759






Which command is used to copy files?

556


What is used to type command?

539


Name the various commands that are used for the user information in unix.

539


What is the behavioural difference between cmp and diff commands?

672


What is rmdir command?

551


What is $0 bash?

646


Which command should you use to find the remaining disk space in unix server?

701


How do you grep a case insensitive?

538


Explain how to use grep command to list find the records of a file containing 10 different strings?

593


What do chmod command do?

600