Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'some small improvements' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
some small improvements
Authored by: yoel on Oct 18, '02 10:35:23AM
This seems like a really good idea. I've written a version in bash that has the following additional advantages: 1. Shorter 2. Doesn't make you specify "-c" to create a new file: it will be created if it does not exist. 3. Lets you list more than one file to edit on the command line. Here's the script:
#!/bin/bash
for i in "$@"; do
    [ ! -e $i ] && touch $i
done
open -a "/Developer/Applications/Project Builder.app" "$@"


[ Reply to This | # ]
some small improvements
Authored by: cubixe on Oct 19, '02 02:49:01AM

Thanks for the suggestions. I'm now using the bash script.

I only had the "-c" option because I was trying to exactly emulate bbedit's behavior. I guess its a personal preference thing, but it makes sense in case you mis-type the file you are attempting to open, the tool won't automatically create a file, it would report that it can't be found.



[ Reply to This | # ]
some small improvements
Authored by: yoel on Oct 19, '02 03:33:35AM

No problem...I'm glad it was helpful. Like you said, the "-c" thing is a matter of personal preference. I'm used to editors like vi, which will create a file if it doesn't exist, but you can make a perfectly valid case for the other way, too.



[ Reply to This | # ]