Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
my code:
#!/bin/sh
export PATH=$PATH:/csc4630/scripts
grep -v '<' "$1" | grep -v 'Back to' | grep - v 'Chapter' | tr " " "\n" | sort | uniq -c > moby{"$1"}lex
end of my codethat is my program, basically takes a file from the command line containing txt, and outputs it to a file, with some sorting and manipulation...
the code is syntax error free
bash$ sh -x mobylex.sh
mobylex.sh: ^M: not found
+ export PATH=/opt/gnu/bin:/home2/jdk1.5.0/bin:/bin:/usr/bin:/usr/ucb:/usr/bin/X11:/usr/local/bin:/usr/local/bin:/opt/local/bin:/usr/gnu/bin:/usr2/local/bin:/mn /local/bin:/usr/ucb:/csc4630/scripts
mobylex.sh: PATH=/opt/gnu/bin:/home2/jdk1.5.0/bin:/bin:/usr/bin:/usr/ucb:/usr/bin/X11:/usr/local/bin:/usr/local/bin:/opt/local/bin:/usr/gnu/bin:/usr2/local/bin:/mnt/local/bin:/usr/ucb:/csc4630/scripts^M: is not an identifier
bash$ sh -n mobylex.shim not sure what that error means, but also before i did that
i did chmod +x mobylex.sh to allow it to become executable
bash$ mobylex.sh 063
bash: mobylex.sh: command not foundanyways, any insight? this is my first time unix scripting

Having given your problem the benefit of my brillant and penetrating mind, I'd say the problem is the space between the "-" and the "v" in the second grep command.
Jerry Lemieux

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |