[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How can I start and immediately background 2 scripts (script1 & ; script2 &)?

Posted on 2006-06-29
11
Medium Priority
?
443 Views
Last Modified: 2008-02-07
I want to do this:

./script/server & ; tail -f log/development.log &

But I get this:

-bash: syntax error near unexpected token `;'

Is there a solution and what is it?



I tried this:

(./script/server &); tail -f log/development.log

which doesn't give a syntax error, but it's not a solution, because the resulting processes don't show up in `jobs`.
0
Comment
Question by:TylerRick
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +2
11 Comments
 
LVL 20

Expert Comment

by:nedvis
ID: 17012217
try changin semicolon (  :   )   to   pipe character (  |  )

nedvis
 
0
 
LVL 15

Accepted Solution

by:
DonConsolio earned 500 total points
ID: 17012306
omit the ";" - the "&" should be enough to terminate the command

use this:
./script/server & ttail -f log/development.log &
0
 
LVL 20

Expert Comment

by:nedvis
ID: 17012325
TylerRick , please,  just ignore my previous post

nedvis
0
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 
LVL 22

Expert Comment

by:pjedmond
ID: 17012408
./script/server & tail -f log/development.log &

making sure that you can spell tail ;)

(   (()
(`-' _\
 ''  ''
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 17012972
> omit the ";"  ..
dooh, another reason to bash bash
:() { :; };:
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17013034
:() { :; };:

Is this an obfuscated bash coding competition?

http://www.de.ioccc.org/main.html
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 17013192
no, not obfuscated, sophisticated bashing :-))
try yourself in a script, but have the kill button handy ...

sorry for being off-topic
0
 

Author Comment

by:TylerRick
ID: 17013906
Thanks for your help, everyone!

Yeah, I don't know why bash has to be so weird. I just assumed that you could separate commands with ; ...

ahoffmann, what shell do you use, if I might ask?
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 17015875
plain old (Bourne) sh for programming 'cause it's up/downward compatible ;-)
KISS - keep it simple stupid

csh, tcsh interactive; zsh sometimes; tclsh if I want lists; bash if all the others are missing (not too bad:)

Some other pros and cons:
  - bash and tcsh can be compiled with special default settings. It's most likely not done, but if, then you may spend a long time to debug some strange behaviours (in particular about reading/executing their resource files at various startups)
  - unfortunatelly some vendors hide the original csh and deliver their own buggy one as csh (HP could be named to blame here)-:
  - ksh is a nightmare, both in programming and using interactive 'cause you often have to check the version to know how to use some features/bugs; then there is pdksh (installed as ksh) which has not all functionality of original ksh
  - bash is strange when it comes to redirect streams
  - with csh it is strange, or even impossible, to handle sevaral streams
  + csh is intuitive to redirect STDOUT together with STDERR in any situation
  + bash and csh have an intuitive and easy to use "jobs" functionality
  + sh is the same on all systems (just some ancient Linux are strange)
  + ksh interactive is for people adicted to emacs ;-)
and finally bash is for bashers (fill in whatever reason, pro or con, you like:-)

STFW and you'll find some sites about pros&cons for each. Mainly csh is blaimed for programming 'cause some behaviours are not realy logical.
These are personal preferences, of course.
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17016336
IMHO - Stick with sh (bash), unless you have a good reason to use one of the others. Of course it's a matter of preference, but as I work on loads of different systems, commonality between distributions is the most important attribute to me:)

(   (()
(`-' _\
 ''  ''

0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 17016366
pjedmond, that's what I said with more words (which is unusal for me;-)
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question