I’m relatively new to programming in c-shell and I’m having a problem with the tr command. When I execute the script, the error message I receive is “tr command not found”. I’m also trying to display the contents of a file in foreach loop that I’ve assigned to a variable. Would this actually only print the name of the file path or its contents? Here’s my code :
#! /bin/csh
set path = /home/students/fall2012/crn12143/ford/friend_list
foreach i ($path)
echo $i | tr '[a-z]' '[A-Z]'
end
You are breaking the path so it can no longer find
tr. Change the path like:Since you aren’t really using
pathlike it should be used, you should consider renaming that variable to something else.If you want to still remove most of the path, use the full path for the
trcommand: