Closed kaushalmodi closed 8 years ago
any reason you are using csh script in the first place?
@rdotdk work
Work laptop? Okay. Let me guess RHEL?
Work laptop?
Sort of, virtual machine.
RHEL?
Yup
I went ahead and replaced git_force_update.csh
with force_update_emacsd.sh
.
https://github.com/kaushalmodi/.emacs.d/commit/646b859885f7980624e4504372540fd844adb8a3
In tcsh
, I use this alias:
alias update_emacs_config '(set e="/tmp/${USER}_force_update_emacsd.sh" \\
&& curl https://raw.githubusercontent.com/kaushalmodi/.emacs.d/master/force_update_emacsd.sh >! $e \\
&& chmod 0755 $e \\
&& $e \!:1)'
@kaushalmodi the script seems to fail with ./force_update_emacsd.sh: [[: not found
error. I think the first line #!/bin/sh
should be #!/bin/bash
.
@rdotdk Thanks for trying. RHEL probably has sh
symlinked to bash
. So I didn't notice it. Let me see if I can use [
instead of [[
. If not, will change the shebang to bash
.
RHEL probably has
sh
symlinked tobash
.
Of course it is :)
> sh --version
GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
As I cannot try the "real sh" on my system, I am going with what you suggested.
@rdotdk Try out after updating to https://github.com/kaushalmodi/.emacs.d/commit/cc6e09dd5fcc863bb7d7d16dc2c5325e98693875
Works without any errors. Tested with bash on Ubuntu system.
RHEL probably has sh symlinked to bash.
In case of debian based systems it is symlinked to dash.
hari@hari-laptop:~$ ll /bin/sh
lrwxrwxrwx 1 root root 4 Nov 1 10:31 /bin/sh -> dash*
Works without any errors. Tested with bash on Ubuntu system.
Thanks for confirming!
Note to self: Never use #!/bin/sh
in shebangs.
Yes. Also the paths shouldn't be mentioned directly in the shebang, instead #!/usr/bin/env bash
should be used for portability.
Thanks, I was almost going to do that as I do the same for perl
. I assumed that bash
would be fine.
But there you go ( https://github.com/kaushalmodi/.emacs.d/commit/bd1131207035c3cf2032e78651febeea6e71e469 ). I cannot not do the right thing. :)
https://github.com/kaushalmodi/.emacs.d/pull/19