Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, I've a script like: test.sh --------------------- #!/bin/bash echo "first" ln -s ~/log/file pks echo "second" --------------------- Is there any way ? so that when my script runs, it should ...
  1. #1
    Just Joined!
    Join Date
    Jun 2006
    Posts
    40

    Is there any way to disable creation of soft link without using #

    Hi,

    I've a script like:

    test.sh
    ---------------------
    #!/bin/bash

    echo "first"

    ln -s ~/log/file pks

    echo "second"
    ---------------------

    Is there any way ? so that when my script runs, it should not create any link as mentioned above . Is that possible ?

    IF I don't want to use a # to make it comment. so what else.......Any help ?

    Thanks-
    Pawan

  2. #2
    Linux Newbie egan's Avatar
    Join Date
    Feb 2009
    Location
    Mountain View, CA
    Posts
    132
    I don't know why you don't want to use a hash mark, but I suppose you could use a here document (this is generally used for larger blocs of text).

  3. #3
    Just Joined!
    Join Date
    Jun 2006
    Posts
    40
    Hello egan,

    Thanks a lot for your suggestion, I just came up with a newer one (newer only to me, might be you're already friendly with this).

    If you use a ":" at the start of any line instead of the usual "#" it won't get executed at all. But, the scope is limited to a single line only, with no other ";" in that line.

    I used the ":" and now the link is not being created by the script.

    I might have posted a silly question, but just to get another trick, in explaining the things to novice users, like me.

    Thanks-
    Pawan


    Quote Originally Posted by egan View Post
    I don't know why you don't want to use a hash mark, but I suppose you could use a here document (this is generally used for larger blocs of text).

Posting Permissions

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