Is there any way to access the exact command line as typed?
(After variable expansion is OK)
It's the only way I can think of to achieve the following:
myscript.sh file1 file2 file3 -m"A multi word comment" [other parameters/options]
-- and inside the script we effectively call --
svn commit file1 file2 file3 -m"A multi word comment" [other parameters/options]
-- without having to duplicate all the parsing that svn does itself, just to make sense of the command line
(The problem I have is that in the example, $4 is going to be "-mA multi word comment" which is going to be a mess to sort out. I'd rather be able to shoot the whole command-line, quotes and all, straight to svn just exactly how svn will want to see it.)
If anyone knows a better way to write an svn "wrapper", I'd also like to hear it.
echo command in linux is used to display line of text/string that are passed as an argument . This is a built in command that is mostly used in shell scripts and batch files to output status text to the screen or a file. In above example, text after \c is not printed and omitted trailing new line.
$* = All the arguments on the command line.
Have you tried in your script:
svn commit "$@"
Explanation:
$@
is a special variable that containing all the arguments to the shell, starting at $1.Inside effectively call you can:
svn commit "$@"
As for seeing exactly how it is typed — no. You can't tell a b
from a b
(note one and two spaces between parameters — argh, I think even SO hides the second space ;)). But you don't need to.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With