01-08-2003
pulling a column from a file in ksh
I would like to pull a column from a file and place it in a variable:
The file would look like this:
N.Korea gibberish garbage
S.Korea gibberish garbage
USA gibberish garbage
Iraq gibberish garbage
Canada gibberish garbage
and items in the first column would be one word only. I would like to place the whole column in a variable. I think sed would be good for this, but I'm not sure of the syntax.
Thanks
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi,
I have a file that contains 1400 lines similar to the one shown below:
NAME=sara, TOWN=southampton, POSTCODE=SO18777, EMAIL=sara@hotmail.com, PASSWORD=asjdflkjds etc etc (note: this is one line).
Each line has the same fields, but on each line they are in a different order. Eg. the line... (2 Replies)
Discussion started by: Saz
2 Replies
2. UNIX for Dummies Questions & Answers
I have return files from a process that has then original input record followed on the next line by a response record..either AA,........... for accepted or EE,.......... for errored.
i.e
11,new,123
AA,accepted
12,exist,443
EE,rejected
13,old,223
AA,accepted
I want to write a small... (4 Replies)
Discussion started by: peter.herlihy
4 Replies
3. Shell Programming and Scripting
i want to add a new column at the end for all the reocrds in a
file
for ex:
file name is abc.wlg.x.y.z
records like
1,2,3,4,5,6,8,y,u,8,1,2,3,4,5,6,8,y,u,8
2,3,4,5,6,8,y,u,8,1,2,3,4,5,6,8,y,u,8,k
3,4,5,6,8,y,u,8,1,2,3,4,5,6,8,y,u,8,k,l
4,5,6,8,y,u,8,1,2,3,4,5,6,8,y,u,8,u,i,o... (4 Replies)
Discussion started by: pulse2india
4 Replies
4. Shell Programming and Scripting
I saw a few posts close to what i want to do, but they didn't look like they would work exactly.. or I need to think out of the box on this.
I have a file that I keep server stats in for my own performance analysis. this file has the output from many commands in it (uptime, vmstats, ps, swap... (2 Replies)
Discussion started by: MizzGail
2 Replies
5. UNIX for Dummies Questions & Answers
I have AIX 5.1
This may sound like a really dumb question but I have never done this before.
I would like to pull a file off a backup tape and put back on the AIX
is this as simple as as doing a
mount /dev/rmt1
then the file name that is on the tape /dump/rpt/xxxxxx
Do I just copy it... (14 Replies)
Discussion started by: rocker40
14 Replies
6. Shell Programming and Scripting
Hi all,
I am fairly new to scripting, but I do try and script as much as possible but the more advanced stuff does tend to boggle my mind a bit.
I am at a bit of a loss with this one.
I get entries in my DNS logs, like the below:
I want to extract only the IP address, without the hashes... (5 Replies)
Discussion started by: codenjanod
5 Replies
7. Shell Programming and Scripting
Hi,
I have a requirment where I need to pull different columns from a .csv file.
Here is the sample of the csv file.
account,item,flag1,flag2,flag3,flag4,flag5,......feed,tran
I will be have a config.txt file which will have the following information.
item,flag5,flag10,feed,tran... (2 Replies)
Discussion started by: akdevula
2 Replies
8. Shell Programming and Scripting
Hi Unix Experts,Team
I have a file (say comand_file.prm), The file has a command specified in column 6 (say "./execute_script.sh"). I want to execute this command in my script.
I am writing a KSH script to achieve this. Could you please assist me with this. (6 Replies)
Discussion started by: Jeevanm
6 Replies
9. UNIX for Dummies Questions & Answers
Hello all,
I'm working on a general script for something at work. I'm an up-and-comer backup for a Shell Scripter this company has had for 35 years lol. Anyway, I have a config file I'm trying to pull Variables from as the Config File is used for multiple scripts. Does the below make sense and... (7 Replies)
Discussion started by: phunk
7 Replies
10. Shell Programming and Scripting
I am connecting to another server through sftp. I am running one batch script to pull file from another server. sometimes i am receiving partial files. I am using below commands in batch script.
ls -ltr new.txt
mget new.txt
bye
The file is of 1 MB only.In most of the cases , i received... (6 Replies)
Discussion started by: srinath01
6 Replies
LEARN ABOUT PHP
mysqlnd_ms_xa_gc
MYSQLND_MS_XA_GC(3) 1 MYSQLND_MS_XA_GC(3)
mysqlnd_ms_xa_gc - Garbage collects unfinished XA transactions after severe errors
SYNOPSIS
int mysqlnd_ms_xa_gc (mixed $connection, [string $gtrid], [boolean $ignore_max_retries])
DESCRIPTION
Garbage collects unfinished XA transactions.
The XA protocol is a blocking protocol. There exist cases when servers participating in a global transaction cannot make progress when the
transaction coordinator crashes or disconnects. In such a case, the MySQL servers keep waiting for instructions to finish the XA transac-
tion in question. Because transactions occupy resources, transactions should always be terminated properly.
Garbage collection requires configuring a state store to track global transactions. Should a PHP client crash in the middle of a transac-
tion and a new PHP client be started, then the built-in garbage collection can learn about the aborted global transaction and terminate it.
If you do not configure a state store, the garbage collection cannot perform any cleanup tasks.
The state store should be crash-safe and be highly available to survive its own crash. Currently, only MySQL is supported as a state
store.
Garbage collection can also be performed automatically in the background. See the plugin configuration directive garbage_collection for
details.
Note
Experimental
The feature is currently under development. There may be issues and/or feature limitations. Do not use in production environments.
PARAMETERS
o $connection
- A MySQL connection handle obtained from any of the connect functions of the mysqli, mysql or PDO_MYSQL extensions.
o $gtrid
- Global transaction identifier (gtrid). If given, the garbage collection considers the transaction only. Otherwise, the state
store is scanned for any unfinished transaction.
o $ignore_max_retries
- Whether to ignore the plugin configuration max_retries setting. If garbage collection continuously fails and the max_retries
limit is reached prior to finishing the failed global transaction, you can attempt further runs prior to investigating the cause
and solving the issue manually by issuing appropriate SQL statements on the participants. Setting the parameter has the same
effect as temporarily setting max_retries = 0.
RETURN VALUES
Returns TRUE if garbage collection was successful. Otherwise, returns FALSE
SEE ALSO
Quickstart XA/Distributed transactions, Runtime configuration, State store configuration, mysqlnd_ms_get_stats(3).
PHP Documentation Group MYSQLND_MS_XA_GC(3)