bash ignores & for last command in loop -


i wrote first bash script start redis instances on development server. while working, last opened redis instance blocking active terminal – though have trailing & sign , other started instances aren't blocking terminal. how push them background?

here's script:

#!/bin/bash  redis=(6379 6380 6381 6382 6383 6390 6391 6392 6393) in "${redis[@]}"     :     redis-server --port $i & done 

it sounds terminal not blocked, prompt got overwritten. it's purely cosmetic issue. due way terminals work, bash doesn't know redraw looks command in foreground.

run script again, , blindly type lsenter. you'll see shell responds normal, though can't see prompt.

you can alternatively hit enter bash redraw prompt.


Comments

Popular posts from this blog

android - net_scheduler holding wakelock -

sql - MySQL : Getting Entries from a many-to-many table -

java - Retrieving data from database using jsp (Hibernate + Spring + Maven) -