User login

bash

Extract and decompress with tar into a directory of another name

Can use

--strip-components=NUMBER
strip NUMBER leading components from file names on extraction

in conjunction with -C

but have to create the directory first anyway, so moving (mv)after the fact is probably easier.

Source

http://superuser.com/questions/146814/unpack-tar-but-change-directory-name-to-extract-to

Rename multiple files

for f in *;do mv $f ${f/test/prod};done

An alternate way to using a rename command, rename 's/dgd7_tip/remarkup/' * (from http://definitivedrupal.org/node/90/ )

Upgrade between Drupal versions using a diff shell script

[This should be on its way to being obsoleted by drush, but i'm using it for Drupal 7 alpha so thought i'd finally make sure it was shared.]

Download this and other useful scripts from their public repository on gitorious.

(Please use the code from the repository, the below may be out of date.)

Helper script for deploying Drupal sites in Agaric's system

To get an agaric project repository, without the helper script, it's simply: git clone git.agariclabs.org:/srv/git/whoswho.git

And get the current version of the script at https://gitorious.org/agaric-scripts

File: 
File: 

Shell commands for untarring (and deleting the archive) a bunch of gzip files

In the process of adding modules Agaric finds useful to Drupal development to a special git repository I did a bit of bash command line scripting that was fun for me:

After a bunch of wget's like:
wget http://ftp.drupal.org/files/projects/schema-6.x-1.3.tar.gz

I ran:

for a in `ls -1 *.tar.gz`; do tar -zxvf $a; done
for a in `ls -1 *.tar.gz`; do rm $a; done

Syndicate content