Code Monkey home page Code Monkey logo

Comments (13)

huyng avatar huyng commented on August 15, 2024

Hey Iperdomo,

Thanks for the heads up. I tried it and it works as long as the bookmark name does not contain a dot in it. The shell script works fine for folders with periods in them.

-H

from bashmarks.

huyng avatar huyng commented on August 15, 2024

I just added in a validation function that checks if bookmarkname is valid

from bashmarks.

huyng avatar huyng commented on August 15, 2024

Sorry, I meant to say that going to folders with dots in the path should work now.

from bashmarks.

iperdomo avatar iperdomo commented on August 15, 2024

hi huyng,
I just pulled the latest changes (rev faff75c) to test it. Now when you try to save a name with a dot in it, you get a message
/tmp/1.0 $ s 1.0
bookmark name is not valid

The weird thing is that now i cannot save using the s command. I can go, list but not save a new bookmark, somehow my shell session gets terminated.

from bashmarks.

huyng avatar huyng commented on August 15, 2024

Hey iperdomo,

Directories with a "." in their paths are valid, but bookmark_names cannot periods. Can you try removing your .sdirs file and let me know if you still can't save new bookmarks?

Thanks,
-H

from bashmarks.

iperdomo avatar iperdomo commented on August 15, 2024

Hi,

I was aware of the bookmark_name restriction. I purged the .sdirs file, and I'm able to save new bookmarks, but, after saving a bookmark (with a valid name) pointing to a folder with a dot, the save command doesn't work anymore.

Steps to reproduce:
$ rm ~/.sdirs
# start new shell (to purge the environment variables)
$ l # should not show any bookmark
$ cd /tmp
/tmp $ s tmp
/tmp $ l # should show the tmp bookmark
/tmp $ mkdir 1.0 && cd 1.0
/tmp/1.0 $ s t1 # fails, also tested with 1, a

Cheers,

from bashmarks.

huyng avatar huyng commented on August 15, 2024

Damn,

Okay we must have something differently configured on our machines. Could send me your ".sdirs" file if you don't mind after running the above sequence? Also, what OS are you running?

Thanks for your help again.
-Huy

from bashmarks.

iperdomo avatar iperdomo commented on August 15, 2024

Hi,
I just tested it again. After removing the .sdirs file I can add 1 bookmark. When I try the 2nd one, it fails. My current .sdirs file only contains one bookmark.

~ $ cat .sdirs 
export DIR_pi="$HOME/workspace/src/openbravo/pi"

~ $ env | grep DIR_
DIR_pi=/home/iperdomo/workspace/src/openbravo/pi

I'm running Gentoo Linux:

~ $ uname -a
Linux por0748 2.6.36-gentoo-r5  SMP Tue Jan 4 12:47:56 CET 2011 i686 Intel(R) Core(TM)2 Duo CPU T7300 @ 2.00GHz GenuineIntel GNU/Linux

~ $ sh --version
GNU bash, version 4.1.9(2)-release (i686-pc-linux-gnu)

Thanks for your support :)

from bashmarks.

radhikalism avatar radhikalism commented on August 15, 2024

I can confirm the same problem (second bookmark fails) on Ubuntu and Debian.

The issue appears to be with the call to mktemp in _purge_line, introduced in commit e1a1181.

For GNU mktemp the template argument pattern must have a number of Xs which it replaces with random characters. BSD mktemp is happy with a simple prefix pattern.

Updating the call to something like mktemp -t bashmarks.XXXXXX is enough for portability between both systems. On BSD, it will simply create a temp file with literal Xs in the name.

from bashmarks.

huyng avatar huyng commented on August 15, 2024

arbscht! thank you .. I was pulling my hair out trying to figure out what was going wrong with the command. I've updated the mktemp call and tested it on my ubuntu machine. I also found another portability bug in the way we were making the "awk" call in the the L command.

could you guys pull the latest version and try it out.

Thanks again for all the help.

Sincerely,
Huy

from bashmarks.

iperdomo avatar iperdomo commented on August 15, 2024

Hi,
I just pulled the latest changes, and now is working fine, hooray! :D

Thank for your support, also want to thank arbscht for his advice.

Cheers,

from bashmarks.

radhikalism avatar radhikalism commented on August 15, 2024

Also works for me. Thanks!

from bashmarks.

huyng avatar huyng commented on August 15, 2024

Sweet, thanks for the help.

from bashmarks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.