Re: [OT] Need some bash scripting assistance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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)

-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux