File not found when using cygwin


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting File not found when using cygwin
# 1  
Old 06-16-2015
File not found when using cygwin

Code:
files="UserRightAssignment.txt"
echo $files
echo '1.1.1.2.2.1;'        `grep -ai '^Modify an object label' $files`

Hi there, I got such an output when using unix,please advise

Code:
1.1.1.2.2.1;
: No such file or directoryxt

I am using
Code:
sh ura.sh


Last edited by alvinoo; 06-16-2015 at 12:24 AM..
# 2  
Old 06-16-2015
I would say your "files" variable has a CTRL-M at the end of it. Perhaps you have txt files in DOS format from where this variable name has been read?

Code:
$ files="UserRightAssignment.txt^M"
$ grep test "$files"
: No such file or directoryxt

# 3  
Old 06-16-2015
Hi

Hi,

I have tried converting the file from dos2unix using cygwin and append and ^M towards the end of the files but both ways does not work.
# 4  
Old 06-16-2015
Quote:
Originally Posted by alvinoo
Hi,

I have tried converting the file from dos2unix using cygwin and append and ^M towards the end of the files but both ways does not work.
Hello alvinoo,

To confirm about ^M characters in a file could you please use following command.
Code:
 cat -v Input_file

Now if above command gives you positive results about file having ^M characters, then you can try following command too.
Code:
 tr -d '\r' < Input_file >Output_file

Hope this helps.


Thanks,
R. Singh
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to find the length of MP4 file in cygwin?

Hi, Apologies if I'm posting in wrong section. How can I find length (duration) of MP4 videos and m4a audio files on cygwin? I heard about mediainfo, ffmpeg, avconv utilities on Linux platform but not sure if they work (or available) on cygwin. Please advise, TIA (1 Reply)
Discussion started by: prvnrk
1 Replies

2. Shell Programming and Scripting

script under cygwin suddenly says command not found

Running bash in cygwin under 2003 Server. I run about 6 shell windows. Every now and then when I check the machine, all of the scripts are scrolling and returning /usr/bin/whatever: command not found. I checked the event log for a windows event that would cause it, but there was nothing. I... (9 Replies)
Discussion started by: gman804s
9 Replies

3. Shell Programming and Scripting

Cygwin - cannot execute binary file

Hey all, I am using Cygwin on a machine running windows 7 64bits. I am about to use the following command: $ faToTwoBit in.fa out.2bit In the manual on sourceforge it mentioned: "Download blat and faToTwoBit and set the blat_bin and fatotwobit_bin entries in config.txt to the fully... (4 Replies)
Discussion started by: @man
4 Replies

4. Shell Programming and Scripting

cygwin syntax error: unexpected end of file

Hi, I am getting error while running the script. "syntax error: unexpected end of file" if i do cat i cant see the content of the script also it is showing as cat test.sh doner /home/master/* /home/Priya/$i| while read i j The original script is paste /home/names.txt /home/ip.txt |... (6 Replies)
Discussion started by: ranjancom2000
6 Replies

5. UNIX for Dummies Questions & Answers

Modify the ssh_config file in Cygwin

Hi all, I have installed Cygwin on my PC and am trying to modify the ssh_config file in the folder 'c:\cygwin\etc\defaults\etc'. However I noticed the owner of that file belongs to root. Unfortunately when I'm opening cygwin each time the default displayed path = 'username@PC', which means I... (1 Reply)
Discussion started by: isaacniu
1 Replies

6. Shell Programming and Scripting

opening new instance of cygwin from withing cygwin

I'm using cygwin on win7, What I would like to do is something like this: cygstart cygwin tail -f /foo/test.log | perl -pe 's/error/\e I know I can start a new instance using either of these: mintty -e ... cygstart tail ... But neither of those open in ANSI mode, so I can't do... (0 Replies)
Discussion started by: Validatorian
0 Replies

7. Shell Programming and Scripting

Cygwin vi XML file encoding problem

Hi, I have got a zip (binary) file transferred from MacOS (thus it has additional __MACOSX directory packed inside). On extracting this zip, there are few *.xml files available. When I opened this *.xml file in vim editor using Cygwin (on windows) the editor displayed in the bottom. I tried... (4 Replies)
Discussion started by: royalibrahim
4 Replies

8. UNIX for Dummies Questions & Answers

convert a .tr file to binary in cygwin

I would like to convert a .tr file to a binary file to use for trace purposes. Can anyone provide any insight? (0 Replies)
Discussion started by: sparklezilla3
0 Replies

9. Shell Programming and Scripting

Run cygwin in .bat file

Hello everyone, I've written quite a few AWK scripts to run in cygwin and now, I would like to run them one after the other in a .bat file. The problem is, I tried modifying the .bat file used to run cygwin in the first place, but whenever I change something, it doesn't work. The PATH is set up... (3 Replies)
Discussion started by: Teroc
3 Replies

10. Windows & DOS: Issues & Discussions

Found by accident: Cygwin tips that still work (most of them)

The link: Cygwin Tips by zzapper Linux Like Environment for Windows The tip I found most useful: Scroll down to this line: It describes how to add useful Windows-side folders to your Cygwin install by changing them into POSIX paths, accessible via cd /<shortcutname> but invisible to... (0 Replies)
Discussion started by: SilversleevesX
0 Replies
Login or Register to Ask a Question