Problem when concatinating wildcard onto file location in bash script
I am having difficulty with the following script:
Essentially, there are a large number of files in the directory ~/data, each with a four-letter code at the beginning (eg. aaaa001 aaaa002 bbbb001 bbbb002 etc). The argument of this script ($1) is one of these four letter codes.
convertFile is a program written in fortran which takes N arguments, the first N-1 being the location of files that will be converted into one file, which will be outputted to the location in the Nth argument.
When I run (for example):
from the terminal, the "aaaa*" is expanded out and convertFile acts on every file in the expanded list (as one would expect). However, when I try to write a script to do this in an automated process, it doesn't expand out the files, instead passing the explicit directory location ~/data/aaaa* (where, for example, $1 = 'aaaa'). I don't know what's wrong, is there something awry with how I'm concatenating the strings?
Hi there,
I am pretty new to linux scripting so ..
I am writing a script to loop through all my directories of sequence files in order to do stuff with them (trimming, normalizing, stuff that one would do with sequence files).
Here I need to pick out files that match each other. The files... (10 Replies)
Hi
This is my third past and very impressed with previous post replies
Hoping the same for below query
How to find a existing file location and directory location in solaris box (1 Reply)
I don't know if this is a big issue or not, but I'm having difficulties. I apoligize for the upcoming essay :o.
I'm writing a script, similar to a paint program that edits images, but in the form of ANSI block characters. The program so far is working. I managed to save the image into a file,... (14 Replies)
I'm writing a bash script that reads a file location from a user, and I'm wondering how to get the script to accept tab to auto complete the directories that are input. (8 Replies)
I tried to use the wildcard '*' in my bash script, but I can not get it work. Here is a simple example (list file names in current directory):
ls ./*
does not work in my bash script. But it works if I use
ls ./
So is there any special syntax to use '*' wildcard in bash script (I tested the... (11 Replies)
Create a script that copies files from one specified directory to another specified directory, in the order they were created in the original directory between specified times. Copy the files at a specified interval. (2 Replies)
how to concatenate particular string in each line of a file..
root$cat conf
check_11043
heartbeat_4345
----------
if i want to add the string "done" output of the file should be
check_11043 done
heartbeat_4345 done (1 Reply)
Hi all
I need to copy the entire contents of one file into an existing file at a specific location. I know the exact line number where I need to put it. It appears I would use either sed or awk to do this, but I have been unsuccessful so far:
File A
line 1
line 2
line 3
line 4
... (6 Replies)
Hi,
I am writing a BASH script. In a directory I have a bunch of files of various filename structures. How do I list all the filenames that begin with either a capital or lowercase A or T. Is there one command that could replace the following 4:
ls A*
ls a*
ls T*
ls t*
Thanks.
Mike (3 Replies)
How can I pass in an argument such as "*.k" to a bash script
without having to double-quote *.k and not having *.k
`glob` to match all files in the pattern?
I tried using noglob in my script but this didn't work the way I thought
it would.. expansion is still occuring, $# is higher than I... (3 Replies)