Bash script to process file without regard for case
Hello,
I have a Bash script that processes a text file so that the existing file will look something like this:
Then the script uses a 'For-Do' loop to copy the files to another directory. Unfortunately, the original text file did not pay attention to case. So, when the copy takes place, some of the files are not recognized because of case and are not copied. Looking around for a solution, I did find the 'shopt -s nocasematch' and stuck it in my script, but it spits out errors.
Can someone give me an idea of how I might copy these files without regard for the case?
Last edited by vgersh99; 04-06-2010 at 07:23 PM..
Reason: code tags, please!
I need to check if $1 is A or B
I tried the following but it seems its not correct..would appreciate a suggestion ?
case "$1"
in
"A" || "B" )
;;
esac
Thanks (4 Replies)
HELLO ALL,
URGENTLY NEEDED A SCRIPT TO SELECT AND DELETE LOWER AND MIXED CASE RECORDS FROM A COLUMN IN A TABLE.
FOR EXAMPLE : Table name is EMPLOYEE and the column name is CITY
and the CITY column records will be: Newyork
washington
... (1 Reply)
Hi All
I have a script which extracts values from a Database (A persons name) and puts it into a variable in my script IE: $NAME
However the Value in the DB is all in uppercase and contains the users first name and last name
EG:
> echo $NAME
GRAHAM BOYLE
>
What I need is only the... (7 Replies)
Below is a test script to illustrate a problem from a larger script I am writing.
$ cat /tmp/loggingtest
#!/bin/bash
lvcreate -s -l 100%FREE -n var-data-snapshot vg00/var-data 2> >(logger -t "loggingtest.crit") 1> >(logger -t "loggingtest.info")
sync &
wait
lvremove -f... (1 Reply)
Hi all,
This is my sample code in /etc/httpd/conf.d/applications.conf file currently we are creating subdomain mannually for every new subdomain. I want to automate this process througs bash script , how its possible.
<VirtualHost *:80>
ServerName google.com
ServerAlias google.com... (5 Replies)
I want to run a script that calls remote ssh and if it gets hung, I want to be able to kill that part of the script and run another command in the script
for example I have a statement like this:
if ];
then
export tapes=$(for tape in $(su - nacct -c 'ssh remote1 "cat... (1 Reply)
Hi All,
Am trying to write wrapper shell/bash script on a utility tool for which i need to pass 2 files as arugment to execute utility tool.
Wraper script am trying is to do with above metion 2 files.
utility tool accepts :
a. userinfo file : which contains username
b. item file : which... (2 Replies)
In the below portion of a bash script the user selects a file from a directory.
select file in $(cd /home/cmccabe/Desktop/NGS/API/5-14-2016/bedtools;ls);do break;done
files in directory
123_base_counts.txt
456_base_counts.txt
789_base_counts.txt
second portion of bash currently (user... (4 Replies)
Hey, im fairly new to unix and Im trying to make this unix project that would display a menu and do the following.
MENU
===========================
(p, P) Print users info
(a, A) Add new user
(s, S) Search user
(d, D) Delete user
(x,X) Exit
Enter your choice:
Trying to... (3 Replies)
Discussion started by: ultimaxtrd
3 Replies
LEARN ABOUT CENTOS
cimreparchive
cimreparchive(8) System Manager's Manual cimreparchive(8)NAME
cimreparchive - create an archive copy of the CIM Server repository
SYNOPSIS
cimreparchive archive_file
cimreparchive --help
cimreparchive --version
DESCRIPTION
The cimreparchive command creates an archive copy of the CIM Server repository in the specified archive_file. The archive copy is assured
to contain a consistent repository state even if it is created while the CIM Server is running.
The archive_file is created using the tar(1) command. To restore the repository from the archive_file, stop the cimserver, move the active
repository files to a different location, use tar(2) to extract the archived repository files, and restart the cimserver. (Note that the
repository location is printed when an archive file is created.)
Options
cimreparchive recognizes the following options:
--help Displays the command help message.
--version Displays the CIM Server version number.
EXIT STATUS
When an error occurs, an error message is written to the standard error stream and a non-zero exit status value is returned. The following
exit status values are defined:
0 Success
1 General error
2 Failed to initiate archive operation
3 Archive operation failed
SEE ALSO cimserver(8), tar(1).
cimreparchive(8)