New answers tagged


You can use history expansion $ echo test !#:^ echo test test test test $ echo a/b/ proj_copy/!#:^ echo a/b/ proj_copy/a/b/ a/b/ proj_copy/a/b/ !# The entire command line typed so far. :^ The first argument You could also use brace expansion $echo test{,} test test $echo {,proj_copy}/a/b/ /a/b/...


What about command argument --parameter=$(tr '\n' ',' < params.txt)


Let's look at this command from the question: command argument --parameter=$(cat params.txt) | tr " " "," This runs the command command argument --parameter=$(cat params.txt) and pipes its output to tr " " ",". That is not what you needed. Try: command argument --parameter="$(echo $(cat params.txt) | tr " " "," )" Here, echo $(cat params.txt) causes ...


You can't disambiguate options with arguments from one another unless a double-dash denotes a long one and a single dash signifies a short one. -f file ...would mean the -f option with its file argument ...whereas --ffile would be a wholly different option without an argument.


This can be helpful (for tar but I think it can be extended to other programs as well): Long options are meant to be obvious and easy to remember, and their meanings are generally easier to discern than those of their corresponding short options (see below). For example: $ tar --create ...


Your other questions at and Is there any way to tell if a shell script was killed with signal 9 indicate that what's missing from your question is that you are trying to run Tomcat under upstart. In such a case: start-stop-daemon is not appropriate. Nor is su. Nor are Poor Man's Daemon Supervisor gyrations to ...


The -s switch for su command is to change the shell of the specified user. The command you want to run must be preceded by -c switch. So the command you are looking for is something like this: su -s /bin/bash -c "$CATALINA_HOME/bin/ run" tomcat


If you're running su as root, you can use -s to specify a different shell (running as root is necessary here since your tomcat user doesn't have a valid shell), and -c to specify the command to run: su -s /bin/sh -c "$CATALINA_HOME/bin/ run" tomcat You might find start-stop-daemon useful; it has a whole slew of options to specify the user and ...

Top 50 recent answers are included