![]() ![]() Where ^M is obtained by typing Ctrl-V Ctrl-M on your keyboard. You could also both grep and standardize the output using sed : sed -n '/COW^M*$/ ' masternospaces.txt If a blank line is shown, you can check that you indeed matched something by using the -v option of cat : grep 'COW]*$' masternospaces.txt | cat -v If you just want grep to match no matter the line ending, you could always specify line endings like this : grep 'COW]*$' masternospaces.txt You can see here or here for various methods of changing line endings using various tools, but for a one-time thing, you could always use vi/vim : vim masternospaces.txt Note the line endings in dos format : 0d 0a. With the output, check the line endings : 0a -> LF, 0d -> CR. grep -a 'grep string' outputfile.txt correct results Some reading has indicated that grep looks for a null character in the first thousand or so bytes. The result is something like this: grep 'grep string' outputfile.txt Binary file outputfile.txt matches. You can use hexdump to check exactly how your line endings are formatted. The problem is that the text file comes out with a binary file flag of some sort. Here is the edited datasync.shĮcho " " > /cygdrive/c/ProgramData/co mpanyname/ _rsync_log s/Data_Fil es_log.As mentionned, the problem is likely to be caused by a different line ending style than what grep is expecting. Yes I understand this command is to increase verbosity. Rsync error: syntax or usage error (code 1) at /home/lapo/package/rsync-3. txt get created but rsync returns this error: Rsync -avz -t -exclude=".DS_Store" -no-owner -no-group -no-perms -chmod=ugo=rwx -e ssh -log-file=/cygdrive/c/Pro gramData/c ompanyname /_rsync_lo gs/Data_Fi les_log.tx t $4 $3 Rsync -avz -t -exclude=".DS_Store" -no-owner -no-group -no-perms -chmod=ugo=rwx -e ssh -log-file=/cygdrive/c/Pro gramData/c ompanyname /_rsync_lo gs/Data_Fi les_log.tx t $3 $4 Rsync -avz -t -exclude=".DS_Store" -no-owner -no-group -no-perms -chmod=ugo=rwx -e ssh -log-file=/cygdrive/c/Pro gramData/c ompanyname /_rsync_lo gs/Data_Fi les_log.tx t $2 $1 ![]() Rsync -avz -t -exclude=".DS_Store" -no-owner -no-group -no-perms -chmod=ugo=rwx -e ssh -log-file=/cygdrive/c/Pro gramData/c ompanyname /_rsync_lo gs/Data_Fi les_log.tx t $1 $2 # $4 = /cygdrive/c/ProgramData/co mpanyname/ Documents/Įcho " " > /cygdrive/c/ProgramData/co mpanyname/ _rsync_log s/Data_Fil es_log.txtĮcho "***** new log entry *****" > /cygdrive/c/ProgramData/co mpanyname/ _rsync_log s/Data_Fil es_log.txtĭate >/cygdrive/c/ProgramData/ companynam e/_rsync_l ogs/Data_F iles_log.t xt # $2 = /cygdrive/c/ProgramData/co mpanyname/ Images/ Here is a copy of the unix datasync.sh script: User: Key: c5e39b7a9d22bafb Path: C:\cygwinĬ:\cygwin\bin /usr/bin system binary,autoĬ:\cygwin\lib /usr/lib system binary,autoĬygdrive prefix /cygdrive user binary,autoġ516k 1 C:\cygwin\bin\cygcrypto-1. System: Key: c5e39b7a9d22bafb Path: C:\cygwin Windows 7 Professional N Ver 6.1 Build 7601 Service Pack 1Ĭ:\Program Files\Common Files\Microsoft Shared\Windows LiveĬ:\Program Files (x86)\Common Files\Microsoft Shared\Windows LiveĬ:\Windows\System32\Window sPowerShel l\v1.0Ĭ:\Program Files (x86)\Windows Live\SharedĬygwin installations found in the registry: Although I can ssh without password through the cygwin terminal without error and call the same rsync commands as in the script manually without error.Ĭurrent System Time: Thu Feb 14 15:23:44 2013 On the Win 7 64 bit machine, the same process does not work. ![]() Our application is calling a datasync.sh script by writing to the dos command prompt. I have ssh installed as local service and privledged separation and start it using hstart as I want to run with highest privileges so do not have to see the console windows. I am trying to automate cygwin rsync by calling a unix shell script in the /cygdrive/c/cygwin/usr/loc al/bin. I am having trouble with the setup on Win 7 64. I have cygwin installed on both a Win 7 32 bit machine and on Win 7 64 bit machine. ![]()
0 Comments
Leave a Reply. |