[SOLVED] Trying to make command into bash alias

Here is a command I would like to make into an easy to use bash alias:
#Copy results of a find to somewhere
find -iname "*something*" -exec cp '{}' /path/to/copy/results/to \;
I realize there are usually several ways to do something in the shell, so if a better way of course I'm all for any tips but if I wanted to make this an alias so that I just had to do:
alias pattern pathtocopyto
How would I? I have tried:
alias findcp="find -iname "$1" -exec cp '{}' $2/ \;"
But this does not work, says it cannot find the search term when I ran it in a test dir full of properly named files and dirs.
TIA for any help
Last edited by colbert (2008-12-17 23:19:09)

Hmm, I tried that Procyon, I could see the HD light on the case go solid so it was running the find but it did not work. I have a file called "layla.mp3" and a dir called "test" in the current dir, ran it like this:
findcp layla test
Gave no result and test was still empty Thanks for the help guys hopefully can get this to go..

Similar Messages

  • AppleScript error on Tiger only: "can't make file into type alias"

    Hi,
    I'm successfully using this smart TextWrangler applescript from this webpage for opening files on the same folder as the current document:
    http://blog.ampli.fi/textwrangler-open-file-from-directory-of-current-file/
    It works fine on Mountain Lion.
    However, when I try it on Tiger 10.4.11, this error dialog appears: "TextWrangler got an error: Can't make [file] into type alias".
    The script basically gets the path of the current document in TextWrangler and posts a file chooser on such path.
    I guess these are the lines that Tiger doesn't like:
      set current_path to POSIX path of current_file
      set new_file to choose file default location (current_path) with multiple selections allowed
    open new_file
    After googling for the error "can't make [] into type alias", I tried to change such lines to:
      set current_path to (POSIX path of (current_file as alias))
      set new_file to choose file default location (current_path) with multiple selections allowed
    open new_file
    But, however, the same error remains.
    Do you have any idea on how could this work?
    Thanks!

    wow, 10.4...
    try this:
    set current_path to current_file
    set new_file to choose file default location (current_path) with multiple selections allowed
    open new_file
    I'm not certain when the standard applescript dialogs were updated to accept posix paths, but it may have been 10.5.

  • [solved] Trying to make a bash function work for (chroot)

    So this is what I have so far.
    function arch-chroot () {
    sudo & mount /dev/sda1 /mnt
    cd /mnt
    mount -t proc proc proc/
    mount --rbind /sys sys/
    mount --rbind /dev dev/
    mount --rbind /run run/
    chroot /mnt /bin/bash
    I get stuck at cd /mnt. This is how I do it in terminal. I can't quite figure out to move past 'cd'.
    # just use the arch-install-scripts. Simple and easy. ------------
    Last edited by jedijimi (2015-01-25 18:11:19)

    It could be something like this:
    if [[ $EUID != 0 ]]; then
    echo "This script should be ran as root" && exit 1
    fi
    mount -t proc /proc $1/proc
    mount --rbind /sys $1/sys
    mount --rbin /dev $1/dev
    mount --rbind /run $1/run
    chroot $1
    This way it uses the default shell and asks for a new root as a parameter. But instead of reinventing the wheel just install arch-install-scripts as it only weights ~0.05MiB. Also when trilby had asked what do you want to do, he meant why are you using "sudo & ..." as sudo can't be run in background.
    Next time you can't find which package provides certain executable file, just use pkgfile.

  • [SOLVED] Trying to make Syslinux visually pleasing...

    So I setup a dualboot with Arch & Windows 8.1 using Syslinux for management. I read all through the Wiki page, set it up accordingly, and it works nicely.
    There's only one thing that really bothers me, and it's the screen resolution whilst in the boot menu. It's not like I'll quit life if I don't work this out, but It'd
    be nice to make it look nice. I used to have a UEFI-GPT scheme on my desktop and back then I used gummiboot, and, even though It lacked advanced
    configuration and personalization, it was very simple and displayed resolution correctly. It was super bare and super perfect.
    On my laptop I'm running a BIOS Legacy-MBR scheme because it came like this, I didn't change it then and it's too late to Zero it all out again.
    I'm using Syslinux now; It's just as simple and easy to use, works just as well and even supports a custom background. The only thing that annoys me
    is the 640x480 max res. It even has a hardware detection tool, I don't see how it wouldn't automatically set resolution to native screen size.
    Is there anyway to set this, or will I have to content myself with the crappy resolution? Here's my Syslinux config file...
    # Config file for Syslinux -
    # /boot/syslinux/syslinux.cfg
    # Comboot modules:
    # * menu.c32 - provides a text menu
    # * vesamenu.c32 - provides a graphical menu
    # * chain.c32 - chainload MBRs, partition boot sectors, Windows bootloaders
    # * hdt.c32 - hardware detection tool
    # * reboot.c32 - reboots the system
    # To Use: Copy the respective files from /usr/lib/syslinux to /boot/syslinux.
    # If /usr and /boot are on the same file system, symlink the files instead
    # of copying them.
    # If you do not use a menu, a 'boot:' prompt will be shown and the system
    # will boot automatically after 5 seconds.
    # Please review the wiki: https://wiki.archlinux.org/index.php/Syslinux
    # The wiki provides further configuration examples
    DEFAULT windows
    PROMPT 0 # Set to 1 if you always want to display the boot: prompt
    TIMEOUT 50
    # You can create syslinux keymaps with the keytab-lilo tool
    KBDMAP br-abnt.ktl
    # Menu Configuration
    # Either menu.c32 or vesamenu32.c32 must be copied to /boot/syslinux
    #UI menu.c32
    UI vesamenu.c32
    # Refer to http://syslinux.zytor.com/wiki/index.php/Doc/menu
    MENU TITLE Fritz BootMenu
    MENU BACKGROUND splash.png
    MENU COLOR border 30;44 #40ffffff #a0000000 std
    MENU COLOR title 1;36;44 #9033ccff #a0000000 std
    MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all
    MENU COLOR unsel 37;44 #50ffffff #a0000000 std
    MENU COLOR help 37;40 #c0ffffff #a0000000 std
    MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std
    MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std
    MENU COLOR msg07 37;40 #90ffffff #a0000000 std
    MENU COLOR tabmsg 31;40 #30ffffff #00000000 std
    # boot sections follow
    # TIP: If you want a 1024x768 framebuffer, add "vga=773" to your kernel line.
    LABEL arch
    MENU LABEL Arch Linux
    LINUX ../vmlinuz-linux
    APPEND root=/dev/sda3 rw
    INITRD ../initramfs-linux.img
    LABEL archfallback
    MENU LABEL Arch Linux Fallback
    LINUX ../vmlinuz-linux
    APPEND root=/dev/sda3 rw
    INITRD ../initramfs-linux-fallback.img
    LABEL windows
    MENU LABEL Windows
    COM32 chain.c32
    APPEND hd0 1
    LABEL hdt
    MENU LABEL HDT (Hardware Detection Tool)
    COM32 hdt.c32
    LABEL reboot
    MENU LABEL Reboot
    COM32 reboot.c32
    LABEL poweroff
    MENU LABEL Poweroff
    COM32 poweroff.c32
    PS: "You can always use GRUB" is not a valid answer
    Last edited by DVNO (2015-03-20 04:42:07)

    Read the wiki. You can set the resolution. https://wiki.archlinux.org/index.php/Sy … _boot_menu
    archwiiki wrote:Since Syslinux 3.84, vesamenu.c32 supports the MENU RESOLUTION $WIDTH $HEIGHT directive. To use it, insert MENU RESOLUTION 1440 900 into your config for a 1440x900 resolution. The background picture has to have exactly the right resolution, however, as Syslinux will otherwise refuse to load the menu.
    PS: you can always use GRUB :-)
    Last edited by 2ManyDogs (2015-03-20 02:35:34)

  • Program doesnt work, tried to make it into array list

    I tried to change this from an array to arraylist and all i got was allot of errors! i was wondering if anyone could help?
    import java.util.*;
    import chn.util.*;
    public class final_proj
    public void quicks(int first, int last);
    int g = first, h = last;
    ArrayList myArrayList = new ArrayList();
    int midIndex = (first + last) / 2;
    int dividingValue = list[midIndex];
    do
    while (list.get(g) < dividingValue)
    g++;
    while (list.get(h) > dividingValue)
    h--;
    if (g <= h)
    //swap(list[g], list[h]);
    int temp = list.get(g);
    list.get(g) = list.get(h);
    list.get(h)= temp;
    g++;
    h--;
    while (g < h);
    if (h > first)
    quickSort (list,first,h);
    if (g < last)
    quickSort (list,g,last);
    //not offering money
    ERRORS
    \\ls-server\userdata\08jleslie\Java\MyProjects\final_proj.java:5: missing method body, or declare abstract
    public void quicks(int first, int last);
    ^
    \\ls-server\userdata\08jleslie\Java\MyProjects\final_proj.java:9: cannot resolve symbol
    symbol : variable first
    location: class final_proj
    int g = first, h = last;
    ^
    \\ls-server\userdata\08jleslie\Java\MyProjects\final_proj.java:9: cannot resolve symbol
    symbol : variable last
    location: class final_proj
    int g = first, h = last;
    ^
    \\ls-server\userdata\08jleslie\Java\MyProjects\final_proj.java:13: cannot resolve symbol
    symbol : variable first
    location: class final_proj
    int midIndex = (first + last) / 2;
    ^
    \\ls-server\userdata\08jleslie\Java\MyProjects\final_proj.java:13: cannot resolve symbol
    symbol : variable last
    location: class final_proj
    int midIndex = (first + last) / 2;
    ^
    The system is out of resources.
    Consult the following stack trace for details.
    java.lang.OutOfMemoryError

    import java.util.*;
    import chn.util.*;
    public class Test
    public void quicks(int first, int last)
    int g = first, h = last;
    ArrayList myArrayList = new ArrayList();
    int midIndex = (first + last) / 2;
    int dividingValue = list[midIndex];
         do
              while (list.get(g) < dividingValue)
                   g++;
              while (list.get(h) > dividingValue)
              h--;
              if (g <= h)
                   //swap(list[g], list[h]);
                   int temp = list.get(g);
                   list.get(g) = list.get(h);
                   list.get(h)= temp;
                   g++;
                   h--;
    while (g < h);
         if (h > first)
              quickSort (list,first,h);
         if (g < last)
              quickSort (list,g,last);
    }An improvement but still doesn't compile because.
    1). import chn.util.*; ???
    2). int dividingValue = list[midIndex]; makes no sinse.
    3). Variable list is never declared.

  • How to execute  make  Command?

      Run in the terminal inside the  make command,prompt:"-bash:make:command not found"  My system version is Mac OS X 10.7.3 Xcode Version is 4.3.
      How to execute  make  Command?
                                    thanks!!

    I switch to / usr / bin directory also did not find the make  only to find a makeinfo. Google to find relevant information, if installed Xcode will be able to run make, but now does not work.
    But still thank you very

  • Make command

    Hi there,
    Ever since I updated Lion to 10.7.2 "make" command(using bash in Terminal) is not working. It says -bash: make: command not found
    Do I need to download something from somewhere?

    Do you have the developers tools installed?
    It is there in my bash.  More info from the manual in terminal:
    man make
    You can  post in the UNIX forum:
    https://discussions.apple.com/community/mac_os/mac_os_x_technologies#/?tagSet=10 48

  • I'm trying to make a slideshow in iMovie, but when I upload photos from my Aperture Library into the iMovie Photo Browser some photos (305 out of 427) are missing. How do I get iMovie to upload all of them?

    I'm trying to make a slideshow in iMovie, but when I upload photos from my Aperture Library into the iMovie Photo Browser, some photos (305 out of 427) are missing. How do I get iMovie to upload all of them?

    I have same problem. I could only see a fraction of my project photos if I browse the Aperture lbrary. It is the same problem when I sync the aperture photos to my iPhone or iPad. I still cannot solve it but I know a way to go around it for your iMovie to see the pictures so that you can work on your iMovie.
    Here is the work around:
    Export the photos from your album to your hard disk and re-import into your iPhoto. Now you should be able to see those photos that you want to work on in iMovie when you browse your iPhot library.

  • Error "Can't make every file of ... into type alias list" - please help!

    Hi
    I am trying to adapt a script that uses Max (an audio conversion tool) to convert files in a folder to another format. The original script which I found on a forum asked the user to choose the folder with the files in which need to be converted, but I want to specify the folder in the script so that it can be automated. So I changed the line:
    set sourceFolder to choose folder
    to
    set sourceFolder to "Macintosh HD:Users:nick:Desktop:test:"
    However I then get the error (this is the only line in the script I changed and the original script works fine):
    error "Can’t make every file of "Macintosh HD:Users:nick:Desktop:test:" whose name extension = "m4a" into type alias list." number -1700 from every file of "Macintosh HD:Users:nick:Desktop:test:" whose name extension = "m4a" to «class alst»
    Could someone let me know why I am getting this error and how I can sort it. The full script is below.
    Thanks
    Nick
    tell application "Max" to activate
    tell application "Finder"
    set sourceFolder to "Macintosh HD:Users:nick:Desktop:test:"
    set theFiles to (every file of sourceFolder) as alias list
    repeat with aFile in theFiles
    tell application "Max"
    convert aFile
    end tell
    delay 1
    tell application "System Events"
    tell process "Max"
    click button "Convert" of tool bar of window "File Conversion"
    set encoderOpen to true
    repeat while encoderOpen is true
    try
    window "Encoder"
    on error
    set encoderOpen to false
    end try
    end repeat
    end tell
    end tell
    end repeat
    end tell

    nick_harambee wrote:
    set sourceFolder to "Macintosh HD:Users:nick:Desktop:test:"
    This saves a string (Macin...) under the variable sourceFolder. You then try and use sourceFolder as an alias which doesn't work. To fix the situation try saving sourceFolder as an actual alias in itself. For example...
    set sourceFolder to folder "Macintosh HD:Users:nick:Desktop:test:"
    or perhaps
    set sourceFolder to "Macintosh HD:Users:nick:Desktop:test:" as alias
    Either of those should correct your problem.
    When using "(choose folder)" you get an alias returned which is why the original script worked fine.

  • I bought creative suite production 6 2 years ago. On 12/24 I guess an update came thru and screwed my program all up. Its trying to make we buy to go into the cloud. I'm happy with what I have, I don't went to go into the cloud. I truely feel like Im bein

    I bought creative suite production 6 2 years ago. On 12/24 I guess an update came thru and screwed my program all up. Its trying to make we buy to go into the cloud. I'm happy with what I have, I don't went to go into the cloud. I truely feel like Im being ripped off being forced to move into the cloud'

    uninstall, clean and reinstall per, Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6

  • How can i solve the contact itunes support issue when trying to make in app purchases

    how can i solve the "please contact itunes support" issue when trying to make in app purchases? my account has available credit from a gift card

    Click here and request assistance.
    (69559)

  • My screen wont light up. Its just blank on my iphone 4. I tried to plug it into the wall but that didnt make it light up it still wont turn on. Then i plugged it into the computer but the screen is still blank. Help me please i need my phone!

    My screen wont light up. Its just blank on my iphone 4. I tried to plug it into the wall but that didnt make it light up it still wont turn on. Then i plugged it into the computer but the screen is still blank. Help me please i need my phone!

    Restart your phone by holding the sleep/wake button and the home button until it starts back up.

  • -bash: make: command not found

    Help me please. I downloaded cdrecord because I need a tool called makeisofs but I am told that I need to compile it first before I can use it. The directions say to type "make" to compile it but when I type make in the terminal window, I get the following message:
    -bash: make: command not found
    I've spent hours looking all over the web for an explanation but I just can not find anything to help me. I even joined some IRC channels but no one types anything in those rooms. It is the weirdest thing.
    Can anyone tell me why I can't compile? The directions I got with the download don't explain a thing.

    I found something that might help. On the second Leopard DVD, there is something called Xcode Tools which I am told has what I need. I'll respond if I have any other questions. Thanks for reading.

  • [SOLVED] ... Copy and paste in xwindows into bash terminal?

    Just to make my Archexperience really interesting I've decided to forego the installation of a DE (for now) and I'm using just the Evilwm. So, what do I need to install to get copy and paste to work beween firefox and my bash terminal.
    In my former Fedora install I used the contextual right-click menu. Any suggestions? A wiki search and google didn't find any ready answers...
    Last edited by xtian (2013-09-17 21:59:51)

    xtian wrote:After a while you get tired of trying to make Linux perform like a commercial OS (OSX, Windoz) and you learn to make do with what works.
    You should get tired of expecting linux to work like any other OS.  But if your goal is for it to perform like those, that is also very easy to do.  Follow thisoldman's advice and you will find dozens of clipboard managers that do what you want.

  • What makes a file unreadable or readable when trying to move it into the library

    What makes a file unreadable or readable when trying to move it into the library

    Any more info? It could be many things including what you are doing - you do not "move" anything to the iPhoto library - you use iPhoto (or image capture) to "import" into iPhoto
    We know nothing except what you tell us so full information and correct terminology is critical to getting valid answers - the more that is left to one guessing and assuming the better the chance of a bad answer
    LN

Maybe you are looking for

  • New security option for Lenovo Vintage. X220 user's suggestion.

    Hi everybody, Almost every model of Lenovo laptops has accelerometer, it used in Airbag protection and Reading optimization prog. I suggest to Vintage programmers to make another new app that uses the data from accelerometer and will be responsible f

  • Hp Scanning

    I have a new HP Photosmart Plus B210 and am trying to scan multiple documents into one .jpeg or .pdf fine. So far I have not been able to figure this out; each doc comes out as a separate file. If that is the case I want to combine my pdf files after

  • Finesse 10.5 Internal Chat

    Hello guys, We have implemented UCCX 10.5 with Finesse for a customer and have tried to enable internal chat for the agents with no success. According to the Data Sheet, Finesse offers the ability to chat with individual members or the entire team (a

  • Loading swf files for anonymous user login

    Hi, We are having swf file retrieving from oracle database in home page. I can able to view swf file for normal users, but anonymous user login, not able to see swf file in the page. Other image format like jpg/gif files anonymous user login images a

  • Create RSS feed in Dreamweaver CS6

    Is there a tutorial or other documentation describing how to add an RSS  feed to a page in Dreamweaver (CS6)? Thanks, Chick