Find the answer to your Linux question:
Results 1 to 4 of 4
Hello, My script below doesn't work because of the dot in the directory name. Does anybody know the workaround? #!/bin/bash DIR=/home/google.com/ cd $DIR...
  1. #1
    Just Joined!
    Join Date
    Apr 2007
    Posts
    2

    BASH: dot in directory name?

    Hello,

    My script below doesn't work because of the dot in the directory name. Does anybody know the workaround?

    #!/bin/bash

    DIR=/home/google.com/

    cd $DIR

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568

    Smile

    Quote Originally Posted by adamcannon
    Hello,
    My script below doesn't work because of the dot in the directory name. Does anybody know the workaround?
    #!/bin/bash
    DIR=/home/google.com/
    cd $DIR
    ---------
    hi that a good question
    try this....

    DIR=/home/google.com/
    cd $DIR
    pwd
    -----------
    it did work -what actually happens...
    sh test.sh --i assume test.sh is your script name
    when run ur script -shell creates child process and which goes to the google.com dir and u got nothing to there...-
    then the child process terminates and comes back to old parent shell.
    It has nothing to do with dot in ur directory name
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

  3. #3
    Just Joined!
    Join Date
    Apr 2007
    Posts
    2
    Adding a "pwd" to the script isn't going to help

  4. #4
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568

    Smile

    Actually what i mean is ...
    cd $dir

    is working....u can change into another directory with ur script.
    it's indeed in /home/google.com directory try and check out with ls or pwd.
    it display content of /home/google.com
    Thanks
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

Posting Permissions

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