Programming :: Using Brace Expansion With Find?

Jun 2, 2011

I am interested in a more flexible targeted search in my directories. For example, if I am searching for all .txt .dat and .bat files (then perform an operation), I would think that the following would work:

find . -name '*.{txt,dat,bat}' -exec ...

But I get no results. I am running on Cygwin.I have confirmed that:

find . -name '*.txt' -exec ...
find . -name '*.dat' -exec ...
find . -name '*.bat' -exec ...

all find the aforementioned files. But, find . -name '*.{txt}'still produces no output.

View 7 Replies


ADVERTISEMENT

Software :: Bash - Brace Expansion Using Variable?

Mar 24, 2010

I'm trying to use brace expansion on a string, but I can't seem to get it working with variable substitution:

Code:

$ cat script.sh
#!/bin/bash
echo {1,2,3} # 1.
VAR=1,2,3

[code]....

I've searched google, tldp.org and these forums and I can't seem to find an example of how this would work. I want #2 to work like #1. Any suggestions?

**Edit: I forgot to add, the values in VAR are not sequential and can have multiple digits. For example, VAR=13,17,10.

**Edit2: [URL] The bottom line of code in the first gray block of code shows that you cannot use variables in such an expansion:

Code:

#!/bin/bash
a=1
b=5
echo {$a..$b}

But I'm looking for pasting the complete contents of a variable into these braces, not some portion of it...

View 2 Replies View Related

General :: Write A Workable Script That Demonstrates That Variable Expansion Occurs Before Pathname Expansion?

Jul 23, 2011

how do I write a workable script that demonstrates that variable expansion occurs before pathname expansion

View 14 Replies View Related

Programming :: [C++] Error: Array Must Be Initialized With A Brace-enclosed Initializer

Jun 29, 2011

I'm implementing exceptions using longjmp() (since C++ exceptions don't offer the features that I need, including resuming and a "finally" block), like this:

Code:

jmp_buf ex_jmpbuf;
void *ex_exception;
bool ex_resumable;
jmp_buf ex_resumebuf;

[code]....

Why are the curly braces being misinterpreted as arrays here, but not anywhere else?

View 11 Replies View Related

Programming :: Debugging Shell Script With A Variable Expansion?

Jan 20, 2011

What I am trying to accomplish is a way to read only the lines that have been added to the file mylog0 since the last time the script looped (5 seconds). I am open to new suggestions too, I have been stuck on this little script for a few hours already.

Code: #!/bin/bash
i=0
firstline=0

[code]...

View 2 Replies View Related

Programming :: Bash Variable Expansion - Immune To Network Failures

Sep 5, 2009

This script is intended to allow you to simultaneously run a command on a set of remote hosts in a single gnome-terminal tabbed window. It runs it through screen so if it's a long process it's immune to network failures.

The command string gets built ok, but when it comes to executing the gnome-terminal command, it chokes with

Quote:

Argument to "--command/-e" is not a valid command: Text ended before matching quote was found for ". (The text was '"ssh')

If you copy/paste the "Running: gnome-terminal" line, it works as expected.

I'm pretty sure the problem is with the commandline variable expansion, but dont know what else to try.

Another thing I'd like to be able to do is keep the shell open after the command finishes. Right now, I just get "screen terminated" and the gnome-terminal tab says bye-bye.

Code:

Code:

View 2 Replies View Related

General :: How To Do Auto Brace In Emacs

Apr 19, 2010

If i type '{' and hit Enter emacs will automatically put '}'. How can i do this?

View 3 Replies View Related

Ubuntu :: Curly Brace Expansions Don't Work In Bash Scripts?

Jul 20, 2010

I'm trying to use a curly brace expansion in a Bash script, but it's not working for me in Ubuntu. It works in other distributions, like Arch, Fedora and Debian, and it works in Ubuntu as well, but only from the command line, not in a Bash script. I've tried it on multiple Ubuntu (10.04) machines, so it's not specific to one configuration. Here's what I did:

Code:
mkdir a b
Now this works:

[code]....

View 3 Replies View Related

Ubuntu :: Expansion Of /home Partition?

Apr 25, 2010

I am reaching the upper limit of my /home partition. As shown in the image attached, my /home is located in /sba3, and I have an additional partition for storage in /sba6. Since Lucid Lynx is about to be released, is it possible using the GPart software on the LiveCD to remove the /sba6 partition, add 1 GiB to my swap partition and the rest to /home without messing up all of my data in /home? So far in my search of the forum I have not come across anything exactly touching this subject, so I am requesting some guidance before proceeding. I have already back up all of my data for a full clean install if it comes to that.

View 2 Replies View Related

General :: Variable Expansion In .bashrc Not Working?

Feb 21, 2011

In my .bashrc file, I am attempting to set JAVA_PATH to a local path, using the HOME environment variable or '~' symbol as shown in the following examples.Using ${HOME}

export JAVA_PATH='${HOME}/Software/java/jdk1.6.0_24'

When I attempt to use ${JAVA_HOME} in a my ${PATH} javec is not found. To debug it, I tried a simple ls command:

ls ${JAVA_HOME}

and get the following error:

ls: ${HOME}/Software/java/jdk1.6.0_24/: No such file or directory

Using '~': Trying to use '~' symbol as follows:

export JAVA_PATH='~/Software/java/jdk1.6.0_24'

the ls command results in the same error, however javac is found.I prefer the '~' symbol anyway, but would like to understand why the ls command does not work for either, and why it seems as though ${HOME} is not being expanded.

View 2 Replies View Related

Hardware :: PCIe To PCI Bus Expansion Chassis: Bad IRQ Number?

Apr 23, 2010

I am testing a PCI card in a 4-slot bus expansion chassis. I bought the chassis from CoolDrives.com, it appears to be identical to the Startech PEX2PCI4 unit, but was quite a bit cheaper... This device shows up on my lspci output:

05:00.0 PCI bridge: Texas Instruments XIO2000(A)/XIO2200(A) PCI Express-to-PCI Bridge (rev 03)

I think that the following line may also be associated with this device:

06:07.0 PCI bridge: Hint Corp HB6 Universal PCI-PCI bridge (non-transparent mode) (rev 11)

I've installed in the expansion chassis one card, a Linux Media Labs BT484 card. This card works out-of-the-box when installed directly in the system, using the bttv driver. Installed in the expansion chassis, the card still shows up as follows:

07:00.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)
07:00.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)
07:01.0 Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11)

[code]....

When the card is installed directly in the motherboard it gets IRQ17 or 18. I suspect that it does not really want IRQ0, but that there is some problem detecting the proper IRQ over the bus expander. One possible approach I am considering is to build a custom version of the driver where I can set the IRQ manually to something else just to get the driver to finish loading, then see what happens when I run the card. This would at least tell me which IRQ the hardware is really using and whether or not the 0 reported is correct or not.

View 1 Replies View Related

General :: Unable To Mount Seagate 1Tb Usb Expansion Drive

Dec 21, 2010

I plugged in a seagate expansion drive 1Tb into my linux server for backup purposes but it is unable to mount it. I can see the expansion drive in My computer but when I click on it, it says unable to mount, device already mounted or busy. Windows can read the hard disk with no problems. It is ntfs formatted. I installed ntfs kernel and fuse. Ntfs is displayed when I run cat /proc/filesystems. However it just can't mount the expansion drive.

View 7 Replies View Related

General :: Can't Mount Volume And Won't Recognize Seagate Expansion Drive

Oct 21, 2010

it says cant mount volume and wont recognize my seagate expansion drive after I had the seagate plugged in to a windows pc! It says something about using command line to fix it but I'm new to Linux and don't know what to do!

View 1 Replies View Related

CentOS 5 :: Df Not Showing Disk Space After Logical Volume Expansion / Fix It?

Jun 5, 2009

I've added a new LUN to my Centos 5.2 server using Powerpath and have added it to an ext3 logical volume. I extended the logical volume using lvextend and the new space shows up correctly in lvdisplay. What I'm having problems with is getting Centos to see the new disk space (df -h shows 500GB, not 600GB as expected). I've tried running a resize2fs on the new volume but it tells me that "the filesystem is already n blocks long. Nothing to do". Does any one know where I'm going wrong? If possible I'd like to sort this without a reboot.

View 3 Replies View Related

General :: Prevent The Logging Of Commands Run Into Syslog As Post-shell Expansion?

Dec 15, 2010

Is there an easy way to prevent the logging of commands run into syslog as post-shell expansion?

I.e log a command of "ls *.log" as just that, rather than "ls a.log b.log c.log d.log" It makes rather a mess of the log files.

View 1 Replies View Related

Ubuntu :: Can't Boot Acer Aspire One (150) From SDHD Installed In System Expansion Port

Jul 27, 2010

I have an Acer Aspire One and I would like to boot from an SCHD card installed into the system Expansion port. It works fine when used in a USB stick. When I check the boot order the expansion port is not listed as an option. There is an option for doing a network expansion. Are there any bios updates that would read that port on startup?

View 1 Replies View Related

Programming :: Unable To Find Description Of Alsa's Programming Language

Dec 19, 2008

I am unable to find a description of alsa's programing language, this sort of stuff:

[Code]...

I need to know what, for example, 'ttable' means and what is its syntax. This seems to be a state secret.

View 2 Replies View Related

Ubuntu :: Expansion Drive Disconnecting - Error: Mount Exited With Exit Code 13: $MFTMirr Does Not Match $MFT (record 0)

Jun 1, 2010

I slipped on my expansion drive cable and it disconnected quickly, when I reconnected I got this error: Error mounting: mount exited with exit code 13: $MFTMirr does not match $MFT (record 0). Failed to mount '/dev/sdb1': Input/output error NTFS is either inconsistent, or there is a hardware fault, or it's a SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows then reboot into Windows twice. The usage of the /f parameter is very important! If the device is a SoftRAID/FakeRAID then first activate it and mount a different device under the /dev/mapper/ directory, (e.g. /dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation for more details.

View 1 Replies View Related

Programming :: Way To Find Core Files In System With Out Using "Find" Command

Jul 30, 2010

Is there any way to find the core files with out using the FIND command?

View 1 Replies View Related

Programming :: GCC - Can't Find The GMP

Dec 28, 2010

I compiled the GMP library and put it into a local directory (I have no idea where to put it otherwise (or how), but I'm just going to use this once anyway). I put this into the terminal:

gcc -L/Users/adm/Downloads/gmp-5.0.1/ -lgmp /Users/adm/Desktop
/main.c
--> gmp.h: No such file or directory

It won't find gmp.h (which is in that directory) and I don't want to compile my file inside the library directory. I have also tried this with no success.

LD_LIBRARY_PATH=/Users/adm/Downloads/gmp-5.0.1/

View 14 Replies View Related

Programming :: Find A Dir And Delete It?

Apr 19, 2010

I've got this line find . -type d -name 'elements' -exec rm -rf {} ; put together to find and delete all directories named elements and their contents.

It does work but whenever I run it I get the error/warning
Code: find: `./dir3/elements': No such file or directory
find: `./dir6/elements': No such file or directory

[code]....

View 4 Replies View Related

Programming :: Find And Cp Not Working?

Aug 6, 2010

The below script takes a date and table name from the user. It unzips and untar a file from archive folder based on date. Then select the required file based on the tablename provided and copy it to ../posextract folder.The folder posextract contains already extracted files for the user.

Code: echo "Enter date
"
read lookdate

[code]....

View 2 Replies View Related

Programming :: Cannot Find -lgtk-x11-2.0?

Aug 7, 2010

root@artos-laptop:~/habesh# /opt/Artos_toolchain_1.3/bin/arm-linux-gcc -o test2 base.c `pkg-config --cflags --libs gtk+-2.0`/opt/Artos_toolchain_1.3/bin/../lib/gcc/arm-linux/3.4.4/../../../../arm-linux/bin/ld: cannot find -lgtk-x11-2.0collect2: ld returned 1 exit statusit compiled for linux succesfully and can execute. i try to cross compile gtk program for ARM board. but it results in this error.

View 2 Replies View Related

Programming :: Cannot Find Wx/mousestate?

Apr 6, 2011

I'm having trouble with codeblocks and a widgets application. Im trying to create a basic application, but i need to include the wx/mousestate.h file. When i compile it cannot find the file. I'm afraid i need to install any module, but i have installed a lot of them and i couldn't solve the problem.

View 3 Replies View Related

Programming :: Can't Find Any Informaton On GCC?

Mar 20, 2010

I would like to learn how to program on Linux but I cant find any informaton on GCC. The manual is like a list that has no meaning to a novice. Are there any books out there that are not writen by Stallman? Is it more practical to learn it on another O.S and then transpose the information over to the Linux context?

View 14 Replies View Related

Programming :: Find The Source For 4ge?

Aug 2, 2011

How to find the source for 4ge programs ?

View 5 Replies View Related

Programming :: How To Find Files With Partial Name

Sep 1, 2010

I am fairly new to linux but I want to write a function to find any file with only a partial name. I can only use sh shell and busybox applets for this.I could do something like the sad code below...

Code:

TEST_ONE=$(find /path/to/directory -name *$1*)
TEST_TWO=$(find /path/to/directory -name $1*)
TEST_THREE=$(find /path/to/directory -name *$1)

[code]....

fi I just made that up but obviously it is pretty bad I'm sure there is a much better way to do it but I just can't think of a way. I also would like to have the file found even if capital letters are used and the file is all lower case.

View 2 Replies View Related

Programming :: Excluding Files From Find?

Oct 22, 2010

I have spent the last hour searching for a solution to this, but I can't get it to work. Here is what I am trying to do:

I have directories for different months in one folder. So for example Code: ../folder/Jan/
../folder/Aug/
etc. Some of the folders have a dot in front of the month as so: Code: ../folder/.Sep/
../folder/.Oct/

[Code].....

I am trying to find all the csv files EXCEPT those in a folder that has a dot. For example I want all the csv files in ../folder/Jan/ but I want none in ../folder/.Oct/.

I also want to exclude all the files in the /Aug/ folder that represent days 10-31.

Here is what I have so far: Code: find /some_path/folder/ ( ! -name "Aug[10-31]*.csv" ! -path "/.*/" -name "*.csv" ) | more This command lists all the .csv files except those in the /Aug/ files. So it just ignores the /Aug/ folder completely but lists every other .csv file.

View 3 Replies View Related

Programming :: Unable To Find The Perl

Mar 9, 2011

Just installed Fedora 14. I wanted to try "Hello World" with perl. But where is it?

Code: [user]@user bin]$ ls

View 1 Replies View Related

Programming :: Find Impacted Exe's For Given Function Name?

Dec 3, 2010

I am looking for some smart way to find all the exe's names for the given local function.
We are having thousands of C and Cobol files, and out of this we are creating 100's of exes. Now if I change any one of the function(C or Cobol), I want to know which exe's are going to be impacted.

One function written in some file can be called from lot other places, and create separate exes.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved