Search Results

Search: Posts Made By: kwatt019
29,039
Posted By kwatt019
Try this out. #!/bin/sh for file in "$@" ...
Try this out.

#!/bin/sh
for file in "$@" do
if file "$file" | grep -q "ASCII text, with CRLF"; then
echo "converting $file"
dos2unix "$file"
fi
doneIf that doesn't working...
29,039
Posted By kwatt019
It does not have dos2unix. I have also tried...
It does not have dos2unix. I have also tried 's/\r$//g' that didn't work. Would ''s//\r$//g' work? I am using vim I don't know if that will make a difference, but I am imputing ^M as ctrl-v ctrl-m....
29,039
Posted By kwatt019
Convert ASCII Text, with CRLF
1. The problem statement, all variables and given/known data:
write a script asciiFix.sh that takes an arbitrary number of file paths from the command line and carries out the same analysis on...
1,228
Posted By kwatt019
My system does not have dos2unix installed on it...
My system does not have dos2unix installed on it and the admin has it to where it cannot be installed. ctrl+v+m is how I got ^M. I was thinking of trying 's/\r$//' in place to see and it worked on...
1,228
Posted By kwatt019
sed to delete ^M
I am trying to use sed to delete the ^M at the end of the line and when i pass a file './asciiFix.sh wintest.txt' I get an error saying sed: can't read : no such file or dir. Can someone give me a...
4,811
Posted By kwatt019
It would help if I could spell wouldn't it...:o ...
It would help if I could spell wouldn't it...:o Once I fixed the spelling errors it worked.
4,811
Posted By kwatt019
Shell script to find file type
1. The problem statement, all variables and given/known data:
Write a shell script that takes a single command line parameter, a file path (might be relative or absolute). The script should examine...
Showing results 1 to 7 of 7

 
All times are GMT -4. The time now is 07:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy