[OT] Need some bash scripting assistance
Dale J. Chatham
dale at chatham.org
Thu Jun 10 16:23:04 UTC 2010
Just to nail the point home, if you have spaces in the name, you must
put quotes around the name of the variable containing the name.
Or:
FILE="a b c.txt"
cat "$FILE"
cat "a b c.txt"
If it has things like "?", "*", or others, Danger Will Robinson!!
On 06/10/2010 11:14 AM, Roberto Ragusa wrote:
>
> If it is the "rotation" part you want help on, I can give you some
> suggestions.
>
> You find the name of the linked file with
> find target -printf "%l\n"
>
> You find the new destination for target with
> ls|grep -A1 "$oldtarget"|tail -1
>
> The end-of-list condition can be handled with an additional dummy
> file and then an explicit if [ "$newtarget" == "ZZZ_after_the_last" ]
> approach. Or you can use a trick like "(ls;ls)|grep -A1 ...".
>
> Is that enough for you to go on?
>
> Take care of the strange characters in filenames, as others have rightly
> pointed out.
>
>
--
Our peculiar security is in the possession of a written Constitution.
Let us not make it a blank paper by construction."
--Thomas Jefferson, letter to Wilson Nicholas, 1803
There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order.
-- Ed Howdershelt (Author)
More information about the users
mailing list