Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Hidden characters in a bash script?

  1. #11
    Join Date
    Aug 2010
    Location
    Lancs, United Kingdom
    Beans
    1,034
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: Hidden characters in a bash script?

    Remove the first 3 characters from the file:
    Code:
    dd bs=1 skip=3 if=vpncheck.sh of=temp
    mv temp vpncheck.sh
    chmod a+x vpncheck.sh

  2. #12
    Join Date
    Apr 2012
    Beans
    4,585

    Re: Hidden characters in a bash script?

    ... or you might have more luck with tr than sed? something like

    Code:
    tr -dc '\11\12\15\40-\176'
    (from here --> http://www.devdaily.com/blog/post/li...ters-file-unix )

  3. #13
    Join Date
    May 2009
    Location
    Courtenay, BC, Canada
    Beans
    1,583

    Re: Hidden characters in a bash script?

    Quote Originally Posted by Stonecold1995 View Post
    Yes, but the problematic characters are placed before the "#"
    it doesn't matter, if you comment something out with #, even after commands, it will still be ignored, for instance:
    Code:
    tye@T:~$ echo test # this is ignored
    test
    tye@T:~$

  4. #14
    Join Date
    Jan 2012
    Location
    /a/
    Beans
    753
    Distro
    Kubuntu 13.04 Raring Ringtail

    Re: Hidden characters in a bash script?

    Quote Originally Posted by HiImTye View Post
    it doesn't matter, if you comment something out with #, even after commands, it will still be ignored, for instance:
    Code:
    tye@T:~$ echo test # this is ignored
    test
    tye@T:~$
    I know that, but the problem was that the hidden characters are before the "#". So like this:
    Code:
    asdf echo test # this is ignored
    Quote Originally Posted by spjackson View Post
    Remove the first 3 characters from the file:
    Code:
    dd bs=1 skip=3 if=vpncheck.sh of=temp
    mv temp vpncheck.sh
    chmod a+x vpncheck.sh
    Thank you! It worked.

    Anyone know what could have caused this? I've only ever used vi, and sometimes Kate and nano.
    The whole thing is so patently infantile, so foreign to reality, that to anyone with a friendly attitude to humanity it is painful to think that the great majority of mortals will never be able to rise above this view of life.
    ~Sigmund Freud

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •