Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I was using & in cshell in the end of a command, in order to execute the command as an independent process from the terminal:

kate filename.txt&

How I should do this in bash?

share|improve this question

2 Answers 2

Using & will background the job, but it is still tied to the shell.

The difference you may find between csh and bash with & is with regard to redirecting STDERR.

In csh:

    kate filename.txt >& kateout.log

In bash:

    kate filename.txt > kateout.log 2>&1

If you want the process to survive the parent shell/terminal closing, try "nohup" i.e.:

    nohup kate filename.txt > kateout.log 2>&1

The redirect is optional; if there is output it will go to nohup.out in the current working directory.

share|improve this answer

The same way. From bash(1):

 If  a  command  is terminated by the control operator &, the shell exe-
 cutes the command in the background in a subshell.  The shell does  not
 wait  for  the command to finish, and the return status is 0.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.