Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eepm
Commits
b4ceac0c
Commit
b4ceac0c
authored
Feb 25, 2014
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove quotes from commands
parent
4cdf5994
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
8 deletions
+38
-8
epm-sh-functions
bin/epm-sh-functions
+9
-8
test_quotes.sh
tests/test_quotes.sh
+29
-0
No files found.
bin/epm-sh-functions
View file @
b4ceac0c
...
...
@@ -124,18 +124,19 @@ showcmd()
docmd
()
{
showcmd
"
$@$EXTRA_SHOWDOCMD
"
"
$@
"
#FIXME
$@
}
# Run every arg with docmd
docmd_foreach
()
{
local
cmd
local
cmd
pkg
cmd
=
"
$1
"
#showcmd "$@"
shift
for
pkg
in
"
$@
"
;
do
docmd
$cmd
$pkg
docmd
"
$cmd
"
$pkg
done
}
...
...
@@ -143,18 +144,18 @@ docmd_foreach()
sudocmd
()
{
showcmd
"
$SUDO
$@
"
$SUDO
"
$@
"
$SUDO
$@
}
# Run every arg with sudocmd
sudocmd_foreach
()
{
local
cmd
local
cmd
pkg
cmd
=
"
$1
"
#showcmd "$@"
shift
for
pkg
in
"
$@
"
;
do
sudocmd
$cmd
$pkg
sudocmd
"
$cmd
"
$pkg
done
}
...
...
@@ -197,7 +198,7 @@ store_output()
local
CMDSTATUS
=
$RC_STDOUT
.pipestatus
echo
1
>
$CMDSTATUS
#RC_STDERR=$(mktemp)
(
"
$@
"
2>&1
;
echo
$?
>
$CMDSTATUS
)
|
tee
$RC_STDOUT
(
$@
2>&1
;
echo
$?
>
$CMDSTATUS
)
|
tee
$RC_STDOUT
return
$(
cat
$CMDSTATUS
)
# bashism
# http://tldp.org/LDP/abs/html/bashver3.html#PIPEFAILREF
...
...
@@ -209,7 +210,7 @@ clean_store_output()
rm
-f
$RC_STDOUT
$RC_STDOUT
.pipestatus
}
# run epm, possible from side repo
epm
()
{
$PROGDIR
/epm
$@
...
...
tests/test_quotes.sh
0 → 100755
View file @
b4ceac0c
#!/bin/sh
SUDO
=
#sudofunc
sudofunc
()
{
echo
"arg1:
$1
"
echo
"arg2:
$2
"
echo
"arg3:
$3
"
echo
"arg4:
$4
"
}
# fake
showcmd
()
{
echo
"
$@
"
}
# Print command line and run command line with SUDO
sudocmd
()
{
showcmd
"
$SUDO
$@
"
#FIXME
$SUDO
$@
}
sudocmd
"ls -l"
"-a -a"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment