User Tools

Site Tools


archive_file_to_path_and_prepare_for_edit

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

archive_file_to_path_and_prepare_for_edit [2009/06/04 15:12]
k2patel created
— (current)
Line 1: Line 1:
-==== archive file to path and prepare for edit==== 
  
-<code bash | archive.sh>​ 
-#!/bin/bash 
-# jt powered 
- 
-cmd=$(basename $0) 
-dt=$(/​bin/​date +%Y%m%d-%H%M) 
-int="​jt"​ 
-archdir="​archive/"​ 
- 
-if [ $# -lt 1 ]; then 
-        cmd=$(basename $0) 
-        echo "​Usage:​ $cmd <​filename>"​ 
-        exit 1 
-fi 
- 
-        if cp -p "​$1"​ "​$archdir$1.$dt.$int"​ 
-        then 
-                ls -l "​$archdir$1.$dt.$int"​ 
-                read -p "Press enter to begin edit" ​ 
-                vim "​$1"​ 
-        else 
-        echo "$cmd quitting: can't make backup?"​ 1>&2 
-        fi 
-</​code>​ 
archive_file_to_path_and_prepare_for_edit.1244128355.txt.gz ยท Last modified: 2020/08/10 02:28 (external edit)