Question regarding expect and ssh
Been trying to get a password reset script working with expect and ran across a problem if I have a $ in the entered password it wraps the variable in {}'s. Not sure if I'm missing an option somewhere or doing something wrong. Newest version of cygwin available. I have tried wrapping with "'s and using \$ and \\$ and neither made a difference. I have confirmed that it is passing "{password1$}" as a full string as my password was changed to that with my initial testing. Thanks, Brian $ ./passexpect_reset.sh ipaddress username password1$ password2 spawn ssh -l username ipaddress -o StrictHostKeyChecking=no {password1$} password2 parent: waiting for sync byte parent: telling child to go ahead parent: now unsynchronized from child spawn: returns {6516} == == passexpect_reset.sh: #!/usr/bin/expect -f exp_internal 1 set ipaddr [lrange $argv 0 0] set username [lrange $argv 1 1] set oldpassword [lrange $argv 2 2] set newpassword [lrange $argv 3 3] set timeout -1 # now connect to remote UNIX box (ipaddr) with given script to execute spawn ssh -l $username $ipaddr -o StrictHostKeyChecking=no $oldpassword $newpassword match_max 10 # Look for passwod prompt expect "*?assword:*" send -- "$oldpassword\r" # Look for shell expect "*$username*" send -- "passwd\r" # Look for passwod prompt expect "*?assword:*" send -- "$oldpassword\r" # Look for passwod prompt expect "*?assword:*" send -- "$newpassword\r" # Look for passwod prompt expect "*?assword:*" send -- "$newpassword\r" # send blank line (\r) to make sure we get back to gui send -- "exit\r" expect eof -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: Looking for txt editors, GUI - New to CYGWIN
Greetings, Christopher Faylor! Thanks, that helps! I am trying to learn more about Apps and how they work with UNIX. Are there any TextEditor or GUI apps that I can download and put into the BIN, and then execute them from Cygwin? >>> Most people use vim, >> >>vim have two modes of work: in first one it beeps, in second - breaks >>everything. > Can we please try to avoid an editors flame war here? Aww, blast. I'm sorry. My message slipped before I've finished the sentence. What I wanted to mention, is that instead of non-obvious and confusing vim, one could use nano, for example. With most, if not all, benefits of vim in addition to intuitive and familiar interface. -- WBR, Andrey Repin (anrdae...@freemail.ru) 17.03.2012, <21:15> Sorry for my terrible english... -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: Can't find program in my path
On Thu, Mar 15, 2012 at 08:25:40PM -0600, Jim Reisert AD1C wrote: > I can't find a particular application in my path. It used to work, > but I haven't run this application since the last couple of Cygwin > releases. > > path(. /cygdrive/d/Home/bin /usr/local/emacs/bin /usr/local/bin > /usr/bin /cygdrive/c/Program Files (x86)/NVIDIA > Corporation/PhysX/Common /cygdrive/d/Perl/site/bin > /cygdrive/d/Perl/bin /cygdrive/d/ActiveState Perl Dev Kit 9.1.1/bin > /cygdrive/c/Windows/system32 /cygdrive/c/Windows > /cygdrive/c/Windows/System32/Wbem > /cygdrive/c/Windows/System32/WindowsPowerShell/v1.0 > /cygdrive/c/Program Files (x86)/Common Files/Acronis/SnapAPI > /cygdrive/d/utility/Diskeeper Corporation/Undelete /cygdrive/c/Program > Files (x86)/QuickTime/QTSystem /cygdrive/d/utility/DISKEE~1/DISKEE~1 > /cygdrive/d/WATCOM/BINNT /cygdrive/d/WATCOM/BINW /usr/bin) A simple 'echo $PATH' would be better here. > # ls "/cygdrive/d/ActiveState Perl Dev Kit 9.1.1/bin" Please note that ActiveState Perl is not really supported here, as cygwin has its own perl. > lib Perl514NH911.dll perlapp-gui.exe perlcov-perl.exe > perlfb.exe perltray.exe plc-gui.exe > Perl510NH911.dll Perl58NH911.dll perlcov.exe perlctrl.exe > perlsvc.exe perltray-gui.exe vbsperl.exe > Perl512NH911.dll perlapp.exe perlcov-gui.exe perlctrl-gui.exe > perlsvc-gui.exe plc.exe > > JJR:~> which perlapp > perlapp: Command not found. > > JJR:~> which perlapp.exe > perlapp.exe: Command not found. > > perlapp is clearly in that directory. I tried some other "which" > commands with files further into the path and they were found. You mean 'which plc' or 'which perlfb' work as expected? > I even did a "chmod og+rwx perlapp.exe" and nothing changed. > # ls -l perlapp > > -rwx--+ 1 SYSTEM SYSTEM 401504 Dec 9 02:01 perlapp.exe Out of curiosity, what does 'getfacl /path/to/perlapp' shows? Do the other executables in the same directory have the same permissions (both DAC and ACL)? Does 'hash perlapp' solve the issue? -- Huella de clave primaria: AD8F BDC0 5A2C FD5F A179 60E7 F79B AB04 5299 EC56 signature.asc Description: Digital signature
Re: argp - Missing initializer and _argp_parse undefined reference
On Mar 16 21:08, John Wicks wrote: > Trying to include argp from Shulman's new package but using the > example code produces a couple errors. > > The first one is missing initializers in the argp structure > > socket1.c:12:15: warning: missing initializer > socket1.c:12:15: warning: (near initialization for ‘argp.children’) > > 12: static struct argp argp = {0,0,0,doc}; > > I was able to fix that by checking the definition of the structure and > setting the other three arguments to 0 as well. > > 12: static struct argp argp = {0,0,0,doc,0,0,0}; > > The last error after fixing the above is: > > $ gcc -Wall -Wextra -pedantic -o socket1 socket1.c > /tmp/ccdeH74x.o:socket1.c:(.text+0x45): undefined reference to `_argp_parse' > collect2: ld returned 1 exit status > > cygcheck -l produces the following: > $ cygcheck -l libargp > /usr/bin/cygargp-0.dll > /usr/include/argp.h > /usr/lib/libargp.dll.a > /usr/lib/libargp.la > > Usually the undefined reference means I'm not including the library. > Do I have to explicitly include -libargp ? Of course. How should gcc know what library you want to link against? It's just -largp, not -libargp (== option -l with library name without the leading "lib" and without the trailing ".a". Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: Status of large address awareness?
On 3/16/2012 9:15 PM, Ryan Johnson wrote: Hi all, What's the current status of large address awareness for cygwin binaries? I know at one point it seemed to be working well -- other than an issue with emacs (fixed now?) -- and there was talk of making it the The emacs problem was fixed last August, as of the release of emacs-23.3-3. default. However, this does not seem to be the case yet, based on looking at peflags for a couple of binaries. It's the default for anything built with Cygwin's current gcc: $ gcc -dumpspecs | grep large-address-aware %{mwindows:--subsystem windows} %{mconsole:--subsystem console} %{!mno-cygwin:%{!mno-use-libstdc-wrappers: --wrap _Znwj --wrap _Znaj --wrap _ZdlPv --wrap _ZdaPv --wrap _ZnwjRKSt9nothrow_t --wrap _ZnajRKSt9nothrow_t --wrap _ZdlPvRKSt9nothrow_t --wrap _ZdaPvRKSt9nothrow_t }} %{shared: %{mdll: %eshared and mdll are not compatible}} %{shared: --shared} %{mdll:--dll} %{static:-Bstatic} %{!static:-Bdynamic} %{shared|mdll: --enable-auto-image-base -e %{mno-cygwin:_DllMainCRTStartup@12} %{!mno-cygwin:__cygwin_dll_entry@12}} %{!mno-cygwin:--dll-search-prefix=cyg %{!shared: %{!mdll: --large-address-aware --tsaware}}} Binaries built with earlier releases of gcc aren't changed. Ken -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
[ANNOUNCEMENT] New Package: lziprecover-1.3-1
Version 1.3-1 of lziprecover has been uploaded. Lziprecover is a data recovery tool and decompressor for files in the lzip compressed data format (.lz) able to repair slightly damaged files, recover badly damaged files from two or more copies, extract undamaged members from multi-member files, decompress files, test integrity of files, extract a range of bytes from a file, and list the correct size of multi-member files. Lziprecover is able to recover or decompress files produced by any of the compressors in the lzip family; lzip, plzip, minilzip/lzlib, clzip and pdlzip. This recovery capability contributes to make the lzip format one of the best options for long-term data archiving. lziprecover was previously part of the lzip package, and is now packaged separately. *** CYGWIN-ANNOUNCE UNSUBSCRIBE INFO *** If you want to unsubscribe from the cygwin-announce mailing list, look at the "List-Unsubscribe: " tag in the email header of this message. Send email to the address specified there. It will be in the format: cygwin-announce-unsubscribe-you=yourdomain.com cygwin.com If you need more information on unsubscribing, start reading here: http://sourceware.org/lists.html#unsubscribe-simple Please read *all* of the information on unsubscribing that is available starting at this URL. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple