tricky ques

Discussion in 'Open Source' started by ravix, Jun 30, 2006.

Thread Status:
Not open for further replies.
  1. ravix

    ravix New Member

    Joined:
    Apr 28, 2006
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    1) can you create a file in linux with name as x/y: containing a '/'.

    2) does this still works:
    echo date is 'date'
    and we get output as
    date is <date/time here>
     
  2. gary4gar

    gary4gar GaurishSharma.com

    Joined:
    May 21, 2005
    Messages:
    4,094
    Likes Received:
    24
    Trophy Points:
    0
    Location:
    Jaipur
    oops!! my bad
     
    Last edited: Jun 30, 2006
  3. JGuru

    JGuru Well-Known Member

    Joined:
    Dec 25, 2005
    Messages:
    1,705
    Likes Received:
    32
    Trophy Points:
    48
    Location:
    Space-time continuum
    I think this not a tips & tricks solution!! @Ravix is just asking an answer for his
    question. Since this is a Open-Source related question it can be at 'Open Source'
    section. Since it's not a Tips n Tricks solution , no need to move this thread!!
     
  4. Satissh S

    Satissh S New Member

    Joined:
    Mar 23, 2005
    Messages:
    692
    Likes Received:
    2
    Trophy Points:
    0
    Location:
    Chennai , India
    @ravix:

    1. No it was not possible to create the file f/g, eg. if i type
    # emacs f/g
    it opens the file g within a unknown directory f in the buffer but it only saves the file inside directory 'f' once i issue 'mkdir f'. This is understandable as directories are container files and to the filesystem a file say my_coolmp3.mp3 within the music directory is a file with actual name as /home/user/music/my_coolmp3.mp3. Atleast thats my understanding of the file system concepts. :) someone correct if wrong.

    Also a file may have several hardlinks to a file so maybe its one of the hardlinks. But a file gets deleted only when the last possible hardlink is deleted.

    2. the output i get for the stanzas,
    $ echo date is 'date'
    date is date
    $ echo 'date is 'date''
    date is date
    $ echo date is date
    date is date
    $echo 'date is date'
    date is date
    are all the same.
     
  5. vignesh

    vignesh New Member

    Joined:
    Jul 20, 2004
    Messages:
    1,658
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Chennai
    You can use this ...

    vignesh@linux-dm4c:~> echo date is $(date)
    date is Sun Jul 2 05:41:35 IST 2006
     
  6. GNUrag

    GNUrag FooBar Guy

    Joined:
    Jun 22, 2004
    Messages:
    1,246
    Likes Received:
    5
    Trophy Points:
    0
    Location:
    Interwebs
    You can use this however,
    $ echo date is `date`
    date is Sun Jul 2 13:41:32 IST 2006

    Note that those are back ticks ` . Adding a back tick `command` is equivalent to $(command)
     
Thread Status:
Not open for further replies.

Share This Page