Here are a few scripts, that I find really useful for speeding up my web development time.
I've been building up this list as I needed to use them - so they maybe a little raw.
For example often clients send me images with filenames that don't match my naming standard, so running the appropriate script really helps keep me focussed on the job in hand and not waste too much time reformatting filenames etc.
Finally if you have any useful little bash scripts why don't you add them to the comments below?
Iterate over the current directory, get all files with .log and append .txt to the end of the entire filename: Liquid error: No such file or directory - posix_spawnp
Converts all the file names in a directory and converts them to lowercase.
echo version: Liquid error: No such file or directory - posix_spawnp
real version: Liquid error: No such file or directory - posix_spawnp
-o print Only the matched parts of a matching line, with each part on a separate line. -H print the filename for each match. -n prefix each line of output with the 1 based line number. -R, -r recursively read all files under subdirectories. Liquid error: No such file or directory - posix_spawnp
{txt,log} this globs the file extensions together. 2>/dev/null this passes all errors to a blackhole, so that they won't be displayed. Liquid error: No such file or directory - posix_spawnp
Find all occurrences of 123741 in all .txt and .log files in all subdirectories. Liquid error: No such file or directory - posix_spawnp
All files with the number 5 in their name. Liquid error: No such file or directory - posix_spawnp
Liquid error: No such file or directory - posix_spawnp
The [ ] is known as a Test, by default it tests integers Also to end an if statement you use fi Liquid error: No such file or directory - posix_spawnp
Note need the / in the evaluation part of "it-0.9.0.7/", don't really need it in grep it-0.9.0.7/ Liquid error: No such file or directory - posix_spawnp
Liquid error: No such file or directory - posix_spawnp
incrementing in a loop Liquid error: No such file or directory - posix_spawnp
Liquid error: No such file or directory - posix_spawnp
Liquid error: No such file or directory - posix_spawnp
Liquid error: No such file or directory - posix_spawnp
Create an HTML version: Liquid error: No such file or directory - posix_spawnp
Create a HAML version: Liquid error: No such file or directory - posix_spawnp
Liquid error: No such file or directory - posix_spawnp
Create a file called something like "my_files.txt" with the following content:
archive_error_112480_0040.txt archive_error_114390_0043.txt etc...
Commands: Liquid error: No such file or directory - posix_spawnp
-e is an undocumented flag that allows escapes Expansion ${command/parameter/substitution} everything else needs to be escaped. Liquid error: No such file or directory - posix_spawnp
Liquid error: No such file or directory - posix_spawnp
NB: you can 'include' other bash .sh scripts in a .bash_profile file by using 'source' or '.'
Use -O to name the remote file, curl will save it locally but remove the rest of the path. Liquid error: No such file or directory - posix_spawnp
If a directory does NOT exist create it Liquid error: No such file or directory - posix_spawnp
If a file exists echo a message: Liquid error: No such file or directory - posix_spawnp
Liquid error: No such file or directory - posix_spawnp
replace spaces for underscores Liquid error: No such file or directory - posix_spawnp
Vim regex to replace spaces in images file names of ah HTML page Liquid error: No such file or directory - posix_spawnp
Liquid error: No such file or directory - posix_spawnp
Some of these are quite basic but useful none-the-less, please add your own to the comments below. Many thanks, and good luck.
This is a script written by a colleague. James Power. Add the following function to your .bash_profile in Apple OSX. Now open a directory in Finder, then open terminal and type cdf, your terminal will now change directory to the same one as the last Finder opened.
Liquid error: No such file or directory - posix_spawnp
Also for a much more comprehensive list of commands check out: http://www.commandlinefu.com/commands/tagged/34/bash
If you use Ruby maybe check out Rush, it allows you do use Ruby in a bash command-line like way.