New answers tagged

4

You can use history expansion $ echo test !#:^ echo test test test test $ echo a/b/test.py proj_copy/!#:^ echo a/b/test.py proj_copy/a/b/test.py a/b/test.py proj_copy/a/b/test.py !# 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/test.py /a/b/...


1

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


3

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 ...


0

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.


1

This can be helpful (for tar but I think it can be extended to other programs as well): https://www.gnu.org/software/tar/manual/html_section/tar_21.html 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 ...


-1

Your other questions at http://stackoverflow.com/questions/37753783/ 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 ...


3

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/catalina.sh run" tomcat


3

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/catalina.sh 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