These forums are read-only!
I can't run scripts on a new Hardy Heron Slice
  • Hi, in the process of setting up a new Hardy Heron Slice, and find I'm not able to run executables, normally I would type ./, for example ./script-name

    Anyone know if that has changed in Hardy?
  • To test this out I created a file called test with the following contents:


    #!/bin/sh

    date


    I then try and run test with:

    sudo ./test

    But I get this response:

    sudo: ./test: command not found
  • Have you checked the mode on the scripts? try chmod +x script-name

    or, if it's a bash script, try simply "sh script-name.sh", ditto python/perl/etc.

    If all that fails, what's the error output?

    edit: ah, thanks, yeah, sounds like permissions. Check this out:
    Lydian ~: cat > test
    #!/bin/sh
    date

    Lydian ~: sudo ./test
    sudo: ./test: command not found
    Lydian ~: ls -l test
    -rw-r--r-- 1 james james 16 2008-05-08 13:24 test
    Lydian ~: chmod +x test
    Lydian ~: sudo ./test
    Thu May 8 13:24:24 PDT 2008
  • OK, now it works for my test file, thanks!

    However, my other executable is not working. This one is an installer for a software package, not sure how to test why it's not working...
  • When I try your other suggestion I get this:

    netinsight@netinsight > sh ntinstall
    ntinstall: 1: Syntax error: "(" unexpected
  • it might not be a bash script. have you tried viewing the source? the first few lines should give you an idea what language it's in
    head ntinstall
    and if it comes out as garbage, then it's compiled in some way, and if it doesn't run, contact the developer. otherwise, if it doesn't say something like #!/bin/sh or #!/usr/bin/python -- paste it in here, someone should recognize it.
  • Ahah, it's garbage!

    netinsight@netinsight > head ntinstall
    ELF?4??i4 (444???|?N|?N??N?^?^?R?W4 h4?4 /lib/ld-linux.so.2GNU??????G?2??%v????d:i????+????????5??????=wa&?????k?? ??????c???'??F??????8?DL???7????????????TI?S??tg??P???Z??(??4?????6??[???bm]??pQ??B3@W
    #AY⎺$)?│⎼\-?O␤U⎽?≠?_?N???J0?┌?
    ?
    ?R?,1??·≥??£?␊ ^?K┼?◆??E?H─??C?┤>.*°π????≤?40@┼@[RPN?◆E?⎻Q?>?????&?◆?
    ?/┐??E?␌├┐ ?? 0?␋@?␤P␌? @??◆2?4????⎻V???(????)?????B?.?OL &? ??0D│@M+PE^◆-⎺⎻????
    ??:??????R1:>·O]? L??_4

    0@??P?◆◆1?⎻:??
    ?B!H!??????└????&?8O? ±!0D?@1P>?◆?⎻>'????==??*?]=?└⎻?4 "? ±?0>X@8≥P?◆'
    ?c??m?@s???:*??"/?2 I???? 6? ?f0?}@?0?L?@??P??`D?p9???
    P?I`:?p??M???E??????X?? ???W?(+?}7? ?7
    $????0D?@q`4
    Jr `?
    \?p+??U1?]q???\?!???k2x=Qt{O q?0?@?? P=O`?kp-9?V????:?t
    ??`4
    ? ~?>?>B?"?g? ??01@?ZPO`?tp?????N???&?`3 ?K#.k ??B% 60?@tWP?d `.?pad?-0
    $???C ??K????? ??C
    @?aPR`U=@0>??h?`p??:\d? ?$??{n?S ?2
    1????┐?K??°>? ? 02? @?P?◆Q⎻- d??&??=B??6????? ?? ?h? ??0"X@O7P:? `?ppt @?E???__gmon_start__libdl.so.2dlerrordlclosedlsym_IO_stdin_useddlopenlibresolv.so.2libpthread.so.0longjmppthread_attr_initpthread_cond_signalpthread_attr_destroyrecvconnectpthread_getspecificpthread_exitpthread_key_deletepthread_mutexattr_destroypthread_equalpthread_createsystemsiglongjmpsendacceptwritepthread_key_createreadpthread_cond_initforksigactionopen64pthread_mutexattr_settypepthread_mutex_unlockfsyncpthread_selfpthread_mutexattr_initpthread_mutex_destroypthread_mutex_lockpthread_cond_wait__errno_locationpthread_cond_destroypthread_mutex_initlseek64openpthread_attr_setdetachstatefcntlpthread_joinclosepthread_setspecificlibstdc++-libc6.2-2.so.3_DYNAMIC__rtti_user__umoddi3__udivdi3__rtti_si__rethrow__deregister_frame_infoterminate__Fv__builtin_vec_new__builtin_vec_delete_GLOBAL_OFFSET_TABLE___rtti_class__builtin_delete__builtin_new__register_frame_infolibm.so.6logsqrtmodfcossinpowlog10__write__terminatelibc.so.6strcpy__divdi3ioctlgetgidprintfsysconf__strtod_internalstdoututimegetloginsigemptysetgnu_get_libc_versionstrerrorfdopengeteuidinet_pton__xpg_basenamememmovesnprintf__strtok_rmunmap__ctype_bgetenvgetegid__rawmemchr__strtol_internalbsearchusleepgetpidqsortfgets__strtoll_internalmemcpysetvbufglobreadlinkputs__cxa_finalizegetuidgetpass__isinffeofmallocendpwentsleepvsnprintficonv_opengethostbyaddrrmdirsocketselectreaddir__strtoul_internalfflush__ctype_toupperrealpathputenvmmapstrncasecmpgetdomainnameaborttznamegmtime_rchmodalarm__sigsetjmpunamestrrchrcallocfprintfkillctimestrcatbindinet_addr__stpcpychdirsetsockoptfseeknl_langinfognu_get_libc_releasememchrstdinumaskmktimetimezoneferrorstrstrrandsignalstrncmpstrncpyunlinkgetrusagestrcasecmprealloc__strdup_IO_getcstrtoksigfillsetlistensscanfstrncatexeclpfreadgethostbyaddr_rstrdupinet_aton__xstat64symlinkgettimeofdaylocaltimememseticonv_closeftellsrandinet_ntoatimeopendir__assert_failpollstrcmpshutdowngetpwuiddupgetcwdgethostbynamegetpwnamgetservbynamefgetcgethostnamesprintf__mempcpyfclosestrerror_rsetlocalegetpeernamegethostbyname_rstderriconv__lxstat64fputcgetservbyport_rgetsockoptglobfreelocaltime_rstrftimefwriteaccess__xstatexit__fxstatinet_ntopfopen_IO_putcfileno__moddi3_setjmpgmtimestrspn__libc_start_mainstrlenreaddir64_rgetrlimitstrchrfputsclosedirtzsetgetservbyname_rmkdir__ctype_tolower__fxstat64vfprintffreegetsocknamefopen64ftruncate64__timezone__tzname_edata__bss_start_endGLIBC_2.1GLIBC_2.0GLIBC_2.2GLIBC_2.1.3GLIBC_2.1.2


    The odd thing is that this file will run on Dapper!?!
  • Anyone know why a certain executable would work on Dapper but not Hardy?
  • Talked this through in IRC, but commenting here for others that might happen by. The installer you are trying to run is a 32-bit executable and to run on an Ubuntu slice, you'll first need to install the package ia32-libs.
  • Hi Jason, thanks for that, but after installing ia32-libs I still get an this error:

    netinsight@netinsight > ./ntinstall
    ./ntinstall: error while loading shared libraries: libstdc++-libc6.2-2.so.3: cannot open shared object file: No such file or directory
  • Seems like the last time this library was available was for Gutsy:

    http://packages.ubuntu.com/search?suite=gutsy&arch=any&searchon=contents&keywords=libstdc++-libc6.2-2.so.3

    Is it okay to apt-get intsall the Gutsy version on Hardy?
  • Fixed it by installing the deb file:

    sudo dpkg --force-all --install libstdc++2.10-glibc2.2_2.95.4-24_i386.deb
  • That is a fairly old version of the c++ standard library your program is requiring. Installing the gutsy version shouldn't cause any problems, though I am not sure why you needed --force-all. Removal from hardy means they don't want to support that version any more, and any bugs or security flaws aren't going to be fixed, but it shouldn't have any affect at all on any applications that don't require that version.

    On another note, the commands 'file' (answers: what the hell is this file?) and 'ldd' (answers: what libraries do I need to run this executable binary) are your friends for solving these problems.
  • Thanks for the background info, good to know!

    Can you also give an example of how to use 'file' and 'ldd', they sound very useful!