Linux.com

dwclarke

dwclarke

  • Linux.com Member
  • Posts: 13
  • Member Since: 26 Apr 11
  • Last Logged In: 22 Dec 11

Latest Posts

Posted by
Topic
Post Preview
Posted
  • dwclarke
    RE: gimp
    Inkscape and Gimp are really for different things. Gimp for bitmapped images, and Inkscape for vector graphics.
    Link to this post 24 Aug 11

    Inkscape and Gimp are really for different things. Gimp for bitmapped images, and Inkscape for vector graphics.

  • dwclarke
    RE: VFAT automount
    Aaaaa, it's KDE. Didn't expect that. Thanks for that. That explains the name case, now to look at the file creation time problem. May be easier, now I know KDE is involved with the process.
    Link to this post 17 Aug 11

    Aaaaa, it's KDE. Didn't expect that.

    Thanks for that. That explains the name case, now to look at the file creation time problem. May be easier, now I know KDE is involved with the process.

  • dwclarke
    RE: VFAT automount
    Well, the question is more, what does Debian use by default for automounting? There is no problem mounting, it's the parameters used when mounting that I want to fiddle with. Environment is KDE.
    Link to this post 17 Aug 11

    Well, the question is more, what does Debian use by default for automounting?

    There is no problem mounting, it's the parameters used when mounting that I want to fiddle with.

    Environment is KDE.

  • dwclarke
    VFAT automount
    When I mount a FAT formatted memory card with Debian 6, files are a) All upper case chars b) The file creation time is taken as UT, not local time. I would like: a) All lower case chars b) The file creation time is taken as local time. I've hunted round the file system, like you do, to see if I can spot the appropriate config files, and also done a fruitless search of the internet. So, what am I looking for is the bit that's responsible for import rules. There you go. Point me to some easily found documentation that I've completely missed.
    Link to this post 17 Aug 11

    When I mount a FAT formatted memory card with Debian 6, files are

    a) All upper case chars

    b) The file creation time is taken as UT, not local time.

    I would like:

    a) All lower case chars

    b) The file creation time is taken as local time.

    I've hunted round the file system, like you do, to see if I can spot the appropriate config files, and also done a fruitless search of the internet.

    So, what am I looking for is the bit that's responsible for import rules.

    There you go. Point me to some easily found documentation that I've completely missed.

  • dwclarke
    RE: what's a good 'language' to learn for scripting?
    Can recommend these for learning Bash: http://tldp.org/LDP/abs/html/ http://tldp.org/LDP/Bash-Beginners-Guide/html/index.html
    Link to this post 11 Jul 11

    Can recommend these for learning Bash:

    http://tldp.org/LDP/abs/html/

    http://tldp.org/LDP/Bash-Beginners-Guide/html/index.html

  • dwclarke
    RE: Programming in C, and Java in a Linux environment.
    Well, at the other end of the scale, I program a lot in C. I use Kate and the command line.
    Link to this post 07 Jul 11

    Well, at the other end of the scale, I program a lot in C. I use Kate and the command line.

  • dwclarke
    RE: New user, need help with basic file management
    A couple of books might be of interest to you. They won't answer all your questions, but it'll help you structuring your little programs. They are the Bash Guide for Beginners and the Advanced Bash Scripting Guide. [url=http://tldp.org/LDP/Bash-Beginners-Guide/html/index.html]Bash Beginners Guide[/url] [url=http://tldp.org/LDP/abs/html/index.html]Advanced Bash Script Guide[/url]
    Link to this post 13 Jun 11

    A couple of books might be of interest to you. They won't answer all your questions, but it'll help you structuring your little programs. They are the Bash Guide for Beginners and the Advanced Bash Scripting Guide.

    Bash Beginners Guide

    Advanced Bash Script Guide

  • dwclarke
    RE: VoIP on Linux? (Skype sold to Microsoft)
    I've been using Skype, but have always had the issue that after 20 mins (exactly) the incoming voice goes burbly and unusable. Never been able to track down the cause of that one. I'm currently looking at Google Talk, which I'm going to test this weekend, but would be interested in other cross platform possibilities.
    Link to this post 12 May 11

    I've been using Skype, but have always had the issue that after 20 mins (exactly) the incoming voice goes burbly and unusable. Never been able to track down the cause of that one.

    I'm currently looking at Google Talk, which I'm going to test this weekend, but would be interested in other cross platform possibilities.

  • dwclarke
    RE: Select with long list
    Thanks for your substantial suggestions, it's been very educational. I'll go through the bits: [b]marc wrote:[/b] [quote]If I may add some suggestions: [code] # Show numerated file list ls *.txt | cat -n | less [/code] Yo do not need to pipe anything here, just do [code] less -N *.txt [/code] [/quote] Your suggestion gave me the contents of the files, whereas I need to search through the file names, to pick one. I did use the -N for less, though, to give me: [code] # Show numerated file list ls *.txt | less -N [/code] [quote] [code] # Check entry is numeric if echo $answer | grep "^[0-9]*$" > /dev/null [/code] Again, you do not need to pipe anything. This checks if it contains non numeric characters: a2 or 34s will fail the test [code] if [[ ! $answer = *[!0-9]* ]] [/code] [/quote] Of course, much simpler, although, should that be '==' not '='?. While Googling, I also found the similar [code] if [[ $answer =~ ^[0-9]+$ ]]; [/code] Which gets rid of the double negation. [quote] [code] # check the number isn't bigger than the list of files count=`ls *.txt | wc -l` [/code] Don't ever parse the output of ls!!!. Insted: [code] f=(*.txt) count=${#f[@]} [/code] [/quote] That works for me, although I'm interested as to why the output of ls shouldn't be used for parsing (besides being unnecessary) [quote] WARNING: this does not check if there are no .txt files <--- it will fail in that case as it will return a one file (the * glob) [/quote] Luckily I do this earlier, in an unshown part of the code. [quote] [code] ourfile=`ls *.txt | sed -n "$answer p"` echo "You chose $ourfile" [/code] I'm not quite sure what's your intention here... ;) [/quote] This takes the number, and converts it into the filename we've picked. With what you've just taught me, I should be able to simplify this. [quote] I'm assuming you are using bash, aren't you? [/quote] Yup [quote] You should avoid `command` as it is deprecated and not easy to nest (try nesting 3-4 things and you'll understand what I mean). Try $(command) instead ;) [\quote] I didn't know that. I've been using the Bash Beginners Guide and Advanced Bash Scripting Guide for my main references. [quote] If you are using bash.... you should use [ [ instead of [ . The [ command (yes, it is a command, not a built in shell option) is, by far, less powerfull than the built in [ [ [\quote] Thanks for that, I've spent a very instructive afternoon re-writing my code. As an aside, anyone copying the code, it is missing the code Exit's, when an error is found.
    Link to this post 04 May 11

    Thanks for your substantial suggestions, it's been very educational. I'll go through the bits:

    marc wrote:

    If I may add some suggestions:

    [code]
    # Show numerated file list
    ls *.txt | cat -n | less
    [/code]

    Yo do not need to pipe anything here, just do

    [code]
    less -N *.txt
    [/code]

    Your suggestion gave me the contents of the files, whereas I need to search through the file names, to pick one. I did use the -N for less, though, to give me:


    # Show numerated file list
    ls *.txt | less -N


    [code]
    # Check entry is numeric
    if echo $answer | grep "^[0-9]*$" > /dev/null
    [/code]

    Again, you do not need to pipe anything. This checks if it contains non numeric characters: a2 or 34s will fail the test

    [code]
    if [[ ! $answer = *[!0-9]* ]]
    [/code]

    Of course, much simpler, although, should that be '==' not '='?. While Googling, I also found the similar


    if [[ $answer =~ ^[0-9]+$ ]];

    Which gets rid of the double negation.


    [code]
    # check the number isn't bigger than the list of files
    count=`ls *.txt | wc -l`
    [/code]

    Don't ever parse the output of ls!!!. Insted:
    [code]
    f=(*.txt)
    count=${#f[@]}
    [/code]

    That works for me, although I'm interested as to why the output of ls shouldn't be used for parsing (besides being unnecessary)


    WARNING: this does not check if there are no .txt files <--- it will fail in that case as it will return a one file (the * glob)

    Luckily I do this earlier, in an unshown part of the code.


    [code]
    ourfile=`ls *.txt | sed -n "$answer p"`
    echo "You chose $ourfile"
    [/code]

    I'm not quite sure what's your intention here... ;)

    This takes the number, and converts it into the filename we've picked. With what you've just taught me, I should be able to simplify this.


    I'm assuming you are using bash, aren't you?

    Yup

    [quote]
    You should avoid `command` as it is deprecated and not easy to nest (try nesting 3-4 things and you'll understand what I mean). Try $(command) instead ;)
    [\quote]

    I didn't know that. I've been using the Bash Beginners Guide and Advanced Bash Scripting Guide for my main references.

    [quote]
    If you are using bash.... you should use [ [ instead of [ . The [ command (yes, it is a command, not a built in shell option) is, by far, less powerfull than the built in [ [
    [\quote]

    Thanks for that, I've spent a very instructive afternoon re-writing my code.

    As an aside, anyone copying the code, it is missing the code Exit's, when an error is found.

  • dwclarke
    RE: virt-install becoming a headache
    I'm not sure if this is related, but could possibly be. I've been unable to install CentOS5.5 or 5.6 into VMWare, with similar error messages of being unable to find the CD. Maybe try your Fedora installation, first, and see if that goes smoother.
    Link to this post 28 Apr 11

    I'm not sure if this is related, but could possibly be. I've been unable to install CentOS5.5 or 5.6 into VMWare, with similar error messages of being unable to find the CD.

    Maybe try your Fedora installation, first, and see if that goes smoother.

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board