Sponsored Content
Full Discussion: Updating a database
Top Forums UNIX for Dummies Questions & Answers Updating a database Post 302378279 by quirkasaurus on Monday 7th of December 2009 12:06:12 PM
Old 12-07-2009
you're saying "database" when you mean "file". these are quite different.

To make things easier on yourself, I would not put all those commands inside an "if" block. For example, in the 2nd if block, you really don't care if "cut" fails. You care if "grep" fails.

Instead, do something like this:
Code:
cut -d: -f 1 $UPDATE > updatetemp.txt
grep -qi "$NAME" updatetemp.txt

if [ $? -eq 0 ]; then
  print success
else
  print fail
fi

Other things I noticed:
Why are you doing this: ( good place for a comment. )
Code:
cut -d: -f 1-3,5 $location | sed -e 's/:/,/gi' > temp.txt

Also: location could just be hard-coded. What's with putting a "find" command there? We don't know where our "database" is?

Also: later, you're blindly echoing the name onto the tes.txt file. Shouldn't that be $location?

Also: don't need double quotes within the case options. nor in those echo commands.

This looks like a mess though. It's a lot of coding to get around the occasional simple editting of a file.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk updating one file with another, comparing, updating

Hello, I read and search through this wonderful forum and tried different approaches but it seems I lack some knowledge and neurones ^^ Here is what I'm trying to achieve : file1: test filea 3495; test fileb 4578; test filec 7689; test filey 9978; test filez 12300; file2: test filea... (11 Replies)
Discussion started by: mecano
11 Replies

2. AIX

.sh_profile not updating

Dear Gurus i have read a lot written on this topic but i just wanna ask that the /etc/profile file is present but the .sh_profile in the users $HOME directory is not being updated, any guesses why??? Also that i need to get the information about the date, time, IP and the user name from which... (7 Replies)
Discussion started by: masquerer
7 Replies

3. Homework & Coursework Questions

UNIX- Database creating/viewing/updating assignment

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I have posted the assignment below, I am new to unix programming and am having a very hard time knowing where... (5 Replies)
Discussion started by: student1989
5 Replies

4. Solaris

redirect solaris database from linux database..

hi.. i have a need .. my php runs on my linux redhat box with mysql.. i want my php code to refer another mysql database which is in solaris 10 x86... can u tell me the procedure .. how it can be done through php .. sorry am new to php... is it possible to redirect from linux mysql to... (7 Replies)
Discussion started by: senkerth
7 Replies

5. Solaris

Can't create database after Oracle Database installation

I installed Oracle 10 software on Solaris 11 Express, everything was fine execpt I can't create database using dbca.rsp file. I populated file with following options. OPERATION_TYPE = "createDatabase" GDBNAME = "solaris_user.domain.com" SID = "solaris_user" TEMPLATENAME = "General... (0 Replies)
Discussion started by: solaris_user
0 Replies

6. AIX

Updating AIX OS

Hello I have a server whose os level reads 5300-01-00-0000. It has to be upgraded to the latest level which is 5300-12-04-1119. What would I need to do go get the server to this point? Would I need to go through each patch level until I get it to current? If so, would anyone happen to know... (1 Reply)
Discussion started by: stayfuzzy
1 Replies

7. Web Development

Updating Records in Mysql Database

so when i issue a command like the below: # mysql --pager=/usr/bin/less -u cactiman -p -e 'select * from data_input' cacti Enter password: ... (2 Replies)
Discussion started by: SkySmart
2 Replies

8. Shell Programming and Scripting

CRON Job to copy database and replace existing database

I have a reseller account with hostgator, which means i have WHM and Cpanel. I have set up a staging environment for one of my wordpress installations (client website), which is essentially sitting at staging.domain.com (live site is at domain.com). The staging website is a complete copy of the... (1 Reply)
Discussion started by: nzrobert
1 Replies

9. Ubuntu

16.04 not updating

Just installed the latest version on my hp stream, was tired of windows. Of the few times I've used Linux, this is the first time it won't update. Im connected to the net the updater recognizes that the OS needs 21 updates. But it won't download/install the updates. It also won't load the... (1 Reply)
Discussion started by: DabblingMadman
1 Replies
grcompiler(1)															     grcompiler(1)

NAME
grcompiler - Compile GDL into a TrueType Font SYNOPSIS
grcompiler [-d] [-D] [-g] [-n number] [-v number] [-w number] [-wall] [-q] gdl-file font-file [output-file] [output-fontname] Description Grcompiler compiles a Graphite Description Language description of the smarts for a font along with a TrueType Font to create a graphite font with graphite tables in it. -d Generate XML debugger file. -D Generate all debugger files. -g Permit and ignore invalid glyph definitions. -nnumber Set name table start location. -q Quiet mode (no messages except on error). -vnumber Set Silf table version number. -wnnnn Ignore warning with the given number. This option may be repeated. -wall Display all warnings. Environment grcompiler makes use of the following environment variables GDLPP Specifies the command to execute to run the GDL preprocessor Files gdlerr.txt Warnings and errors are output to this file. dbg_classes.txt Debug file that specifies the classes stored in the font in terms of their GDL source and containing glyph ids in hex. dbg_cmap.txt Debug file giving Unicode to glyph mapping of all the glyphs in the font and vice versa. dbg_enginecode.txt Debug file containing the action code and constraint code associated with each pass and rule in a pass. dbg_fsm.txt Debug file that gives the finite state machines of each pass and the rules referenced. For each pass, a mapping is given between glyph and column number. dbg_glyphattrs.txt Debug file containing all the glyph attributes and their names, along with values specified for each glyph. dbg_parsetree.txt Debug file giving the complete parse tree of the GDL source file. dbg_ruleprec.txt Debug file that lists the rules in precedence order (order in which they will be tested) for each pass. $_temp.gdl Debug file containing the output of gdlpp Author Martin Hosken <mhosken@users.sourceforge.net> $Date: 2012-05-29 11:36:50 $ grcompiler(1)
All times are GMT -4. The time now is 11:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy