[CentOS] Maybe OT : strange wildcard behaviour
cpolish at surewest.net
cpolish at surewest.netTue Oct 26 02:12:30 UTC 2010
- Previous message: [CentOS] Maybe OT : strange wildcard behaviour
- Next message: [CentOS] CentOS Digest, Vol 69, Issue 24
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> If the app supports it (most good GNU like apps do) you need the double dash
> option which will end option processing (ls -l -- -my_stupid_file.foo-)
A script to rename files with unhelpful names:
#! /bin/bash
# Rename files by choosing from a menu C. Polisher 2003/04/21
ls -i
echo -n "Enter inode of file to rename: "
read j
wasname=`find . -maxdepth 1 -inum "${j}" -printf "%p"`
wasname=`echo "${wasname}"|cat -vET`
echo -ne "\nEnter new name for inode ${j}"
echo -n "${wasname}"" : "
read newname
echo -ne "\nrename ${wasname} to ${newname} (y or n)? "
read yorn
while true
do
case "${yorn}" in
Y|y|yes|YES|Yes|yES)
find . -maxdepth 1 -inum "${j}" -exec mv \{\} "${newname}" \;
break
;;
*)
break
;;
esac
done
--
Charles Polisher
- Previous message: [CentOS] Maybe OT : strange wildcard behaviour
- Next message: [CentOS] CentOS Digest, Vol 69, Issue 24
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list