Permalink
Browse files

escaped cat avoids alias

  • Loading branch information...
1 parent c503718 commit 52264235369c9b96c883101ed629f78109ce2293 @robotarmy robotarmy committed Apr 2, 2013
View
2 binscripts/rvm-installer
@@ -525,7 +525,7 @@ case "${version}" in
(latest-minor)
echo "${version}" > "$rvm_path/RELEASE"
- version="$(cat "$rvm_path/VERSION")"
+ version="$(\cat "$rvm_path/VERSION")"
install_release $(fetch_version "${version%.*}") || exit $?
;;
View
2 scripts/alias
@@ -171,7 +171,7 @@ alias_list() {
typeset item
case "${alias_name}" in
(names)
- cat - # just show it
+ \cat - # just show it
;;
(*)
while
View
2 scripts/cli
@@ -870,7 +870,7 @@ Error:
unset rvm_rvmrc_files
fi
- disk_version="$(cat "$rvm_path/VERSION") ($(cat "$rvm_path/RELEASE" 2>/dev/null))"
+ disk_version="$(\cat "$rvm_path/VERSION") ($(\cat "$rvm_path/RELEASE" 2>/dev/null))"
if
[[ -s "$rvm_path/VERSION" &&
"${rvm_version:-}" != "${disk_version:-}" &&
View
2 scripts/cron
@@ -43,7 +43,7 @@ __rvm_cron_command()
__sm.cron.show()
{
- EDITOR=cat crontab -e 2>/dev/null
+ EDITOR=\cat crontab -e 2>/dev/null
}
__sm.filter.remove.group()
View
4 scripts/env
@@ -11,9 +11,9 @@ then
elif
[[ "$rvm_cron_flag" == "1" || "$*" =~ "--cron" ]]
then
- cat "$environment_file_path" |
+ \cat "$environment_file_path" |
GREP_OPTIONS="" \grep -Eo "[^ ]+=[^;]+" |
sed -e 's/\$PATH/'"${PATH//\//\/}"'/' -e 's/\${PATH}/'"${PATH//\//\/}"'/'
else
- cat "$environment_file_path"
+ \cat "$environment_file_path"
fi
View
2 scripts/external
@@ -31,7 +31,7 @@ external_grep_existing()
then
GREP_OPTIONS="" \grep -vE "${existing[*]}" -
else
- cat -
+ \cat -
fi
}
View
4 scripts/extras/rails
@@ -121,14 +121,14 @@ rails_routes()
md5_current=${md5%% *}
if [[ -s "$cache_file" && -s "$cache_file.md5" ]]; then
- md5_cached=$(cat -v "${cache_file}.md5")
+ md5_cached=$(\cat -v "${cache_file}.md5")
md5_cached=${md5%% *}
else
md5_cached=""
fi
if [[ -s "$cache_file" && $md5_current == $md5_cached ]]; then
- routes=$(cat -v "$cache_file")
+ routes=$(\cat -v "$cache_file")
else
routes=$(rake routes 2>/dev/null)
if [[ $? -gt 0 ]]; then
View
4 scripts/functions/benchmark
@@ -14,7 +14,7 @@ __rvm_benchmark()
unset code
- cat $rvm_ruby_file >> "${rvm_tmp_path}/$$.rb"
+ \cat $rvm_ruby_file >> "${rvm_tmp_path}/$$.rb"
printf "%b" "\n end \nend\n" >> "${rvm_tmp_path}/$$.rb"
@@ -27,7 +27,7 @@ __rvm_benchmark()
if [[ ${rvm_debug_flag:0} -gt 0 ]] ; then
printf "%b" "\n${rvm_tmp_path}/$$.rb:\n\
- $(cat ${rvm_tmp_path}/$$.rb)"
+ $(\cat ${rvm_tmp_path}/$$.rb)"
fi
View
2 scripts/functions/build
@@ -167,7 +167,7 @@ __rvm_update_configure_opt_dir_flags()
{
typeset __enable_rpath __lib_path
if
- which bash | xargs head -n 1 | cat -e | \grep -b '^^?ELF' >/dev/null
+ which bash | xargs head -n 1 | \cat -e | \grep -b '^^?ELF' >/dev/null
then
__enable_rpath="true"
fi
View
2 scripts/functions/build_config
@@ -387,7 +387,7 @@ __rvm_detect_max_threads()
fi
;;
(*)
- cat /proc/cpuinfo 2>/dev/null | (grep vendor_id || echo 'one';) | wc -l
+ \cat /proc/cpuinfo 2>/dev/null | (grep vendor_id || echo 'one';) | wc -l
;;
esac
}
View
2 scripts/functions/env
@@ -194,7 +194,7 @@ __rvm_unload_action()
typeset -a _list
IFS=$'\n'
- _list=( $( cat ${2:--} | sort -u ) )
+ _list=( $( \cat ${2:--} | sort -u ) )
for _element in "${_list[@]}"
do $1 "${_element}"
done
View
2 scripts/functions/group
@@ -43,7 +43,7 @@ __rvm_list_all_users()
dscl . -search /Users PrimaryGroupID 20 | GREP_OPTIONS="" \grep PrimaryGroupID | cut -f 1
;;
*)
- GREP_OPTIONS="" \grep -xF -f <(cat /etc/passwd | cut -d: -f1) <(find /home -mindepth 1 -maxdepth 1 -type d | cut -d '/' -f 3)
+ GREP_OPTIONS="" \grep -xF -f <(\cat /etc/passwd | cut -d: -f1) <(find /home -mindepth 1 -maxdepth 1 -type d | cut -d '/' -f 3)
;;
esac
}
View
2 scripts/functions/installer
@@ -1006,7 +1006,7 @@ setup_etc_bashrc()
[[ -f "${new_content_path}" ]] || \rm -f "${new_content_path}"
{
print_etc_bashrc_change # prepend
- cat "${system_bashrc_file}"
+ \cat "${system_bashrc_file}"
} > "${new_content_path}" &&
\mv "${new_content_path}" "${system_bashrc_file}"
fi
View
6 scripts/functions/logging
@@ -100,8 +100,8 @@ rvm_debug_stream()
{
(( ${rvm_debug_flag:-0} || ${rvm_trace_flag:-0} )) || return 0
if rvm_pretty_print stdout
- then cat - | awk '{print "'"${rvm_debug_clr:-}"'"$0"'"${rvm_reset_clr:-}"'"}'
- else cat -
+ then \cat - | awk '{print "'"${rvm_debug_clr:-}"'"$0"'"${rvm_reset_clr:-}"'"}'
+ else \cat -
fi >&2
}
rvm_log()
@@ -211,6 +211,6 @@ __rvm_table()
echo "$1" | __rvm_table_wrap_text
fi
__rvm_table_br
- cat "${2:--}" | __rvm_table_wrap_text
+ \cat "${2:--}" | __rvm_table_wrap_text
__rvm_table_br
}
View
2 scripts/functions/manage/macruby
@@ -97,7 +97,7 @@ macruby_install()
binaries=(erb gem irb rake rdoc ri ruby testrb)
for binary_name in ${binaries[@]}; do
# TODO: This should be generated via an external script.
- ruby_wrapper=$(cat <<RubyWrapper
+ ruby_wrapper=$(\cat <<RubyWrapper
#!/usr/bin/env bash
export GEM_HOME="\${GEM_HOME:-$rvm_ruby_gem_home}"
View
4 scripts/functions/rvmrc_project
@@ -153,11 +153,11 @@ __rvm_load_project_config()
rvm_previous_environment="$(__rvm_env_string)"
rvm_current_rvmrc="$1"
- rvm_ruby_string="$(cat "$1")"
+ rvm_ruby_string="$(\cat "$1")"
[[ -n "${rvm_ruby_string}" ]] || return 2
if [[ -f "$(dirname $1)/.ruby-gemset" ]]
then
- rvm_gemset_name="$(cat "$(dirname $1)/.ruby-gemset")"
+ rvm_gemset_name="$(\cat "$(dirname $1)/.ruby-gemset")"
fi
rvm_create_flag=1 __rvm_use || return 3
# "$(dirname $1)/.rbenv-vars" ... can we support those without licensing ?
View
4 scripts/functions/rvmrc_trust
@@ -31,12 +31,12 @@ __rvm_sha256_for_contents()
__rvm_checksum_for_contents()
{
typeset __sum
- __sum=$( echo "$1" | cat - "$1" | __rvm_md5_for_contents ) ||
+ __sum=$( echo "$1" | \cat - "$1" | __rvm_md5_for_contents ) ||
{
rvm_error "Neither md5 nor md5sum were found in the PATH"
return 1
}
- __sum+=$( echo "$1" | cat - "$1" | __rvm_sha256_for_contents ) ||
+ __sum+=$( echo "$1" | \cat - "$1" | __rvm_sha256_for_contents ) ||
{
rvm_error "Neither sha256sum nor shasum found in the PATH"
return 1
View
2 scripts/functions/rvmrc_warning
@@ -68,7 +68,7 @@ __rvmrc_warning_list()
{
rvm_log "# List of project files that ignore warnings:"
if [[ -s "$__rvmrc_warning_path" ]]
- then cat "$__rvmrc_warning_path"
+ then \cat "$__rvmrc_warning_path"
fi
}
View
10 scripts/functions/utility
@@ -342,7 +342,7 @@ __rvm_version_compare()
__rvm_pager_or_cat_v()
{
- eval "${PAGER:-cat -v} '$1'"
+ eval "${PAGER:-\cat -v} '$1'"
}
__rvm_ask_for()
@@ -362,8 +362,8 @@ __rvm_read_lines()
IFS="
"
if [[ "${2:--}" == "-" ]]
- then eval "$1=( \$( cat - ) )"
- else eval "$1=( \$( cat \"\${2:--}\" ) )"
+ then eval "$1=( \$( \cat - ) )"
+ else eval "$1=( \$( \cat \"\${2:--}\" ) )"
fi
}
@@ -449,7 +449,7 @@ __rvm_detect_system()
[[ -f /etc/debian_version ]]
then
_system_name="debian"
- _system_version="$(cat /etc/debian_version)"
+ _system_version="$(\cat /etc/debian_version)"
elif
[[ -f /etc/fedora-release ]]
then
@@ -478,7 +478,7 @@ __rvm_detect_system()
[[ -f /etc/gentoo-release ]]
then
_system_name="gentoo"
- _system_version="base-$(cat /etc/gentoo-release | awk 'NR==1 {print $NF}' | awk -F. '{print $1"."$2}')"
+ _system_version="base-$(\cat /etc/gentoo-release | awk 'NR==1 {print $NF}' | awk -F. '{print $1"."$2}')"
elif
[[ -f /etc/arch-release ]]
then
View
2 scripts/get
@@ -4,7 +4,7 @@ source "$rvm_scripts_path/base"
get_usage()
{
- cat -v "$rvm_help_path/get"
+ \cat -v "$rvm_help_path/get"
}
get_via_installer()
View
2 scripts/help
@@ -46,7 +46,7 @@ __rvm_help()
else
[[ -z "$1" ]] || rvm_error "Documentation for 'rvm $*' not found"
- cat "${rvm_path:-$HOME/.rvm}/README" | sed '1,2d' | __rvm_pager_or_cat_v -
+ \cat "${rvm_path:-$HOME/.rvm}/README" | sed '1,2d' | __rvm_pager_or_cat_v -
rvm_log "
Commands available with 'rvm help':
View
2 scripts/info
@@ -51,7 +51,7 @@ info_rvm()
version: \"$(__rvm_version | \tr "\n" ' ' | __rvm_strip)\"
"
rvm_info="${rvm_info} updated: \""
- installed_at="$(cat ${rvm_path}/installed.at)"
+ installed_at="$(\cat ${rvm_path}/installed.at)"
if
[[ -n "${installed_at:-}" ]] && (( installed_at ))
then
View
2 scripts/list
@@ -262,7 +262,7 @@ list_known()
then
__rvm_pager_or_cat_v "$rvm_path/config/known"
else
- cat "$rvm_path/config/known"
+ \cat "$rvm_path/config/known"
fi
return $?
View
12 scripts/maglev
@@ -86,9 +86,9 @@ case "$system" in
totalMemKB=$(awk '/MemTotal:/{print($2);}' /proc/meminfo)
totalMem=$(($totalMemKB * 1024))
# Figure out the max shared memory segment size currently allowed
- shmmax=$(cat /proc/sys/kernel/shmmax)
+ shmmax=$(\cat /proc/sys/kernel/shmmax)
# Figure out the max shared memory currently allowed
- shmall=$(cat /proc/sys/kernel/shmall)
+ shmall=$(\cat /proc/sys/kernel/shmall)
;;
Darwin)
@@ -188,8 +188,8 @@ then
case "$system" in
Linux)
echo "# kernel.shm* settings added by MagLev installation" > /tmp/sysctl.conf.$$
- echo "kernel.shmmax=$(cat /proc/sys/kernel/shmmax)" >> /tmp/sysctl.conf.$$
- echo "kernel.shmall=$(cat /proc/sys/kernel/shmall)" >> /tmp/sysctl.conf.$$
+ echo "kernel.shmmax=$(\cat /proc/sys/kernel/shmmax)" >> /tmp/sysctl.conf.$$
+ echo "kernel.shmall=$(\cat /proc/sys/kernel/shmall)" >> /tmp/sysctl.conf.$$
;;
Darwin)
# On Mac OS X Leopard, you must have all five settings in sysctl.conf
@@ -212,8 +212,8 @@ then
if [[ "$system" != "SunOS" ]]
then
rvm_log "Adding the following section to /etc/sysctl.conf"
- cat /tmp/sysctl.conf.$$
- sudo bash -c "cat /tmp/sysctl.conf.$$ >> /etc/sysctl.conf"
+ \cat /tmp/sysctl.conf.$$
+ sudo bash -c "\cat /tmp/sysctl.conf.$$ >> /etc/sysctl.conf"
/bin/\rm -f /tmp/sysctl.conf.$$
fi
else
View
10 scripts/notes
@@ -7,7 +7,7 @@ fi
if [[ "$1" == "initial" ]]
then
notes_type=Upgrade
- PAGER=cat
+ PAGER=\cat
new_notes()
{
typeset file
@@ -22,7 +22,7 @@ then
elif [[ "$1" == "upgrade" ]]
then
notes_type=Upgrade
- PAGER=cat
+ PAGER=\cat
new_notes()
{
typeset file
@@ -43,7 +43,7 @@ else
notes_type=Installation
new_notes()
{
- cat
+ \cat
}
important_message()
{
@@ -85,7 +85,7 @@ $notes_type Notes:
: \
rvm_scripts_path:${rvm_scripts_path:-$rvm_path/scripts}:
- cat "$rvm_path/help/upgrade-notes.txt" | sed \
+ \cat "$rvm_path/help/upgrade-notes.txt" | sed \
-e "s/\${SHELL}/${SHELL//\//\/}/g" \
-e "s/\${rvm_scripts_path}/${rvm_scripts_path//\//\/}/g"
@@ -240,7 +240,7 @@ $notes_type Notes:
rm /usr/local/bin/rvm
"
fi
-} | new_notes | eval "${PAGER:-cat}"
+} | new_notes | eval "${PAGER:-\cat}"
rvm_warn "
# RVM: Shell scripts enabling management of multiple ruby environments.
View
2 scripts/patchsets
@@ -21,7 +21,7 @@ lookup_patchset()
do
if [[ -s "$lookup_path/$1" ]]
then
- cat "$lookup_path/$1"
+ \cat "$lookup_path/$1"
return 0
fi
done
View
2 scripts/rvm
@@ -131,7 +131,7 @@ then
__rvm_setup
export rvm_version
- rvm_version="$(cat "$rvm_path/VERSION") ($(cat "$rvm_path/RELEASE" 2>/dev/null))"
+ rvm_version="$(\cat "$rvm_path/VERSION") ($(\cat "$rvm_path/RELEASE" 2>/dev/null))"
alias rvm-restart="rvm_reload_flag=1 source '${rvm_scripts_path:-${rvm_path}/scripts}/rvm'"
View
2 scripts/snapshot
@@ -177,7 +177,7 @@ snapshot_load()
\cp -f "$snapshot_temp_path/db" "$rvm_user_path/db"
rvm_log "Installing rvm-managed packages"
- for snapshot_package in $(cat "$snapshot_temp_path/pkg")
+ for snapshot_package in $(\cat "$snapshot_temp_path/pkg")
do
"$rvm_scripts_path/package" install "$snapshot_package"
result="$?"
View
2 vboxtest/test_helper.sh
@@ -20,7 +20,7 @@ assert_status_equal () {
}
assert_output_equal () {
- expected=$(cat); actual=$1; lineno=$2
+ expected=$(\cat); actual=$1; lineno=$2
if [ "$actual" != "$expected" ]
then
View
2 vboxtest/test_suite.sh
@@ -65,7 +65,7 @@ then
}
echo
- cat "$messages_file"
+ \cat "$messages_file"
echo "$(count_char "\." "$results_file") pass, $(count_char "F" "$results_file") fail"
rm "$messages_file" "$results_file"
fi

0 comments on commit 5226423

Please sign in to comment.