Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Starting PERL Script

  1. #1

    Default Starting PERL Script

    I have a simple PERL script that sorts through a CSV address file and outputs a file formated for printing labels.

    Typing the filename in a terminal window in the directory of the file, results in a not found in the form

    If 'all_labels' is not a typo you can use command-not-found to lookup the package that contains it, like this:
    cnf all_labels


    But when I run the program from the parent directory like this

    ../labels/all_labels

    It runs just fine.

    Any Idea why this is happening in SuSE 11.3.... it ran OK in an older version of SuSE.

  2. #2
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Starting PERL Script

    On 2011-10-26 03:26, orrinsam wrote:

    > Typing the filename in a terminal window in the directory of the file,
    > results in a not found in the form


    As it should be.

    A program can not be run unless it is in the $PATH. You can bypass that
    rule if you specify the path, like ./program

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

  3. #3
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,378

    Default Re: Starting PERL Script

    As an addition to the above, I would suggest to put your executables in the directory bin within your home directory. That directory is by default in your PATH environment variable. From then on you can type
    Code:
    all_labels
    from anywhere to start it.
    Henk van Velden

  4. #4

    Default Re: Starting PERL Script

    I found that in YAST, the option for adding the 'dot' to the user path is suppose to be default to YES. For some reason, mine got set to NO. I clicked on the default and everthing works now.

    Since this is a single user system, the security risk is minimal.

  5. #5
    Join Date
    Oct 2008
    Location
    Glasgow, Scotland
    Posts
    1,151

    Default Re: Starting PERL Script

    Quote Originally Posted by orrinsam View Post
    Since this is a single user system, the security risk is minimal.
    So you never connect to the Internet? It's "user-friendly" stuff like that that makes MS Windows so "secure".

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,378

    Default Re: Starting PERL Script

    Only when that "single user" is never making mistakes, the security risk is minimal. But let every generation experience these things the hard way.
    Henk van Velden

  7. #7

    Default Re: Starting PERL Script

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Looking in Yast I do not see any reason this should be a default. The
    option is there, both for 'root' as well as for other users, but it is
    not a default and never should be. If you really want a command to work
    as described you should put it in your PATH which could be as simple as
    putting it in the 'bin' directory within your own user's home directory.
    Having your CWD in your PATH means anytime somebody (as mentioned by
    eng-int, including via something from the Internet that you don't
    expect, because that's how they all are) happens to put 'ls' in your
    home directory (because you have rights there) and you then run 'ls'
    whatever code is in there will trump the system's 'ls' command and your
    user is now compromised, assuming you don't have system rights in which
    case your entire system is gone even though you knew you only ran the
    'ls' command.

    Good luck.
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.15 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

    iQIcBAEBAgAGBQJOqE01AAoJEF+XTK08PnB5xVAP/iESBWc4J/z1DPaCsB0P4jAE
    nkDkDzxAnh1rO0gJzvKQ+NkZGoxsx5hc+17xUfMzXzicUNrOjXYHS4/L43V5tO75
    ohOtw5gaAAnhGi78mC+sYEbpYC6TbD/hLjKwrhEFopWOJWssHu5hbKSnIRSN1LXe
    TANxFmI/kfF2kILoxb1tOaynUaNwqJbizBK7zHrIJYo79UJwX1fqx5OKGD+WkDJY
    GQ1R8KjdCFfMqN7efq5arZEwtn/oiKbgHFfQt+aX3SepsvdvVArKyRLK0MzPG6jX
    O4BrrbUF8IAGb79CFkhdDC6MWI4kUaXYTVnGu2DagZX03gwQYnIPYzA8zvIM/9kD
    M8Khm4P1A1Hea5VQ2MQQjmM+Tu4UTYK7VSKPOp4eFco/dlnuT1KRQi4bucXwkW4z
    MQiNKtUzJW1OK1KhoR/p4DvBrduX7iDghCzxo2Lg88h2J0nDgJa6nTIzaiu3meuX
    /fOOzLxpQkWEpJLUT81pWJw7/c6rdrijR30+FxBazyzAOgOjR4B/mzf6eIPS+6KS
    L+9O4JkTaTe5ePY2E8ORkjmZZVQTGpENRcvL6bs89Nf2tAvHB+FLiWZMWEX7gyH0
    jjkrxSL1ZHqTWZqBOSCnVkPNLeMiCk4htRHyFyY7x5BIYLRRZW2oHfWUKyrF+yxk
    0iPxupkHhULOP1emoA2d
    =ZR/E
    -----END PGP SIGNATURE-----

  8. #8

    Default Re: Starting PERL Script

    Quote Originally Posted by ab View Post
    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Looking in Yast I do not see any reason this should be a default. The
    option is there, both for 'root' as well as for other users, but it is
    not a default and never should be.
    This is from YAST in 11.3

    Possible Values: yes,no
    Default Value: yes
    Configuration Script: groff
    Description:

    Do you want to have "." in the path for normal users?
    Defaults to "yes" since this has been the case for years.

  9. #9
    Join Date
    Oct 2008
    Location
    Glasgow, Scotland
    Posts
    1,151

    Default Re: Starting PERL Script

    Quote Originally Posted by orrinsam View Post
    This is from YAST in 11.3

    Possible Values: yes,no
    Default Value: yes
    Configuration Script: groff
    Description:

    Do you want to have "." in the path for normal users?
    Defaults to "yes" since this has been the case for years.
    This is serious misinformation.

    I have been using SuSE/openSUSE since it was SLS, and I cannot recall it ever having these insecure $PATH defaults. This is the Description/Help message from YaST in 11.4 -- it's the same in 11.3:
    By default the current working directory is not used when searching for executables.
    Some systems set up a work-around by adding the dot (".") to the search path, enabling files in the current path to be found and executed. This is highly dangerous because you may accidentally launch unknown programs in the current directory instead of the usual systemwide files. As a result, executing Trojan Horses, which exploit this weakness and invade your system, is rather easy if you set this option.
    This setting applies for root user and system users.
    If your system is otherwise then it is seriously misconfigured, and should not be trusted until you satisfy yourself as to how it has arrived at that state.

  10. #10
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,654

    Default Re: Starting PERL Script

    eng-int wrote:

    >
    > orrinsam;2397682 Wrote:
    >> This is from YAST in 11.3
    >>
    >> Possible Values: yes,no
    >> Default Value: yes
    >> Configuration Script: groff
    >> Description:
    >>
    >> Do you want to have "." in the path for normal users?
    >> Defaults to "yes" since this has been the case for years.

    >

    I can see the same text in yast and I am surprised to see it (started with
    S.u.S.E. 16 1/2 years ago in early '95) I cannot remember (am I getting so
    old that I can't remember) that . was ever part of the users default path.
    And it is exactly not by default set to yes on any of my systems. So what
    will yast tell us here?

    --
    PC: oS 11.4 64 bit | Intel Core i7-2600@3.40GHz | KDE 4.6.0 | GeForce GT 420
    | 16GB Ram
    Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.7.2 | nVidia
    ION | 3GB Ram

Page 1 of 2 12 LastLast

Posting Permissions

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