Thread: Memory stick

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    20
    Rep Power
    0

    Memory stick


    i can mount a memory stick using mount -t msdosfs /dev/da0s1 /mnt but i can't copy any files into it.
    with current directory as /mnt if i try cp /usr/home/web9452/c!/misc/text.c . it comes back and says /misc/test.c : event not found. wtf? I am using Free BSD 7.0 release 0.
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,625
    Rep Power
    4247
    The ! in your command line is what is causing the issue. To the shell, the ! character has a special meaning, unless you escape it out with \. Try this instead:
    cp /usr/home/web9452/c\!/misc/text.c .

    In case you're wondering what ! means to the shell: it helps to execute previous commands.

    You can view previous commands you typed by typing "history". It will then list all the recent commands you ran, along with numbers listing the various commands e.g.
    Code:
    ...
    121  cd /home/foo/bar
    122  cp /home/foo/bar/baz /home/foo/somewhere/else.txt
    123  ls -al
    124  gcc -o foo foo.c
    125  emacs /path/to/file.txt
    Now say you want to rerun the cp command again. Instead of retyping the whole thing, you can simply type "!122" and the shell will rerun the command. Similarly, if you want to rerun the previous command, you can type "!!". You can also rerun a specific command by typing ! followed by the first few characters of the command. E.g. if you wanted to rerun the gcc command you did earlier, you could simply type "!gcc"

    Hence, when the shell saw !/misc/text.c, it looked in your history for a command that you typed earlier that started with /misc/text.c. On not finding any such event, it helpfully reported that "event was not found".

    Therefore, if you really want to type a !, you must do it as \!
    Last edited by Scorpions4ever; August 16th, 2013 at 04:13 AM.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    20
    Rep Power
    0

    sh shell


    Originally Posted by web9452
    i can mount a memory stick using mount -t msdosfs /dev/da0s1 /mnt but i can't copy any files into it.
    with current directory as /mnt if i try cp /usr/home/web9452/c!/misc/text.c . it comes back and says /misc/test.c : event not found. wtf? I am using Free BSD 7.0 release 0.
    when i type h in the sh shell it acts like the history command as it should(i think) because of an alias. but if I try typing history at the command line it says history not found. for the csh and tcsh shells history works. the .cshrc files for all three shells look identical. is there anyway to change the login shell?
  6. #4
  7. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,625
    Rep Power
    4247
    man chsh or edit /etc/passwd and change the shell for your login.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo

IMN logo majestic logo threadwatch logo seochat tools logo