Menu

#8 Encourage dot (`.`) over `source`

open
nobody
None
5
2014-08-13
2014-08-08
mcandre
No

I believe source is a bashism, that POSIX shell only recognizes dot (.) instead. In the future, could checkbashisms report lines that contain source?

Discussion

  • mcandre

    mcandre - 2014-08-08

    Note: Except for csh/tcsh, which are non-POSIX compliant. csh and tcsh only recognize source, not dot (.).

     

    Last edit: mcandre 2014-08-08
  • mcandre

    mcandre - 2014-08-08

    Some modern descendants like ash/dash do not recognize source, only dot (.), making this bashism check more important.

     
  • Mike Frysinger

    Mike Frysinger - 2014-08-13

    this is already handled. please post an example script where it doesn't work for you.

    $ printf '#!/bin/sh\nsource foo\n' > test.sh
    $ checkbashisms test.sh
    possible bashism in test.sh line 2 (should be '.', not 'source'):
    source foo
    
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.