8 if [ -e "$queue_dir/$taskid.end" ]
12 pidfile
=$queue_dir/$taskid.pid
16 exec {task_lock_fd
}>>"$pidfile"
17 flock
--shared --nonblock "$task_lock_fd"
30 # load the NUL-delimited command and its arguments from the given file
31 # and put in bash global $command[@] array.
35 declare -g -a command=()
36 exec {fd
}<"$command_file"
37 while read -r -d $
'\0' -u $fd arg
45 queue_dir
=${DEFAULT_QUEUE_DIR:-}
55 echo "Usage: $usage_help_text"
62 qls_show_exit_status
=yes
64 -E|
--no-task-exit-code)
65 qrun_return_task_status
=''
70 -h|
--hide|
--side-state)
72 qls_hide_states
="$qls_hide_states $1"
80 -M|
--no-multiline|
--escape-command)
94 qrun_suppress_output
=yes
106 echo "${0##*/}: unknwon option: $1" >&2
114 if [ -z "$queue_dir" ]
116 # load default queue dir
117 if [ -e ~
/.config
/qadd
/default-queue-dir
]
119 queue_dir
=`head -n 1 ~/.config/qadd/default-queue-dir`
120 queue_dir
=${queue_dir/#~\//$HOME/}
121 mkdir
-p "$queue_dir"
125 if [ -z "$queue_dir" ]
127 echo "${0##*/}: specify the queue control directory." >&2
136 exec {lock_fd
}>>"$queue_dir/.lock"
137 flock
--exclusive $lock_fd