Sponsored Content
Top Forums Shell Programming and Scripting pulling a column from a file in ksh Post 33537 by Perderabo on Wednesday 8th of January 2003 02:34:00 PM
Old 01-08-2003
How about:
Code:
x=$(cut -d ' ' -f 1 < file)

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Pulling out fields from a file

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

pulling the following line from a file

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

to add new column for all reocrds in a file in KSH please

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

Pulling data and following lines from file

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

Pulling a file off a backup tape

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

Pulling Ip's from log and redirecting to a file

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

pulling different fields from a csv file

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

KSH Script to Execute command from specific column in file

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

Pulling Parms from Config File

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

Partial file pulling

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
S2CI(1) 						      General Commands Manual							   S2CI(1)

NAME
s2ci - Scheme interpreter SYNTAX
s2ci [ option ] DESCRIPTION
The s2ci command (previously known as sci) invokes a Scheme interpreter. The language accepted by this interpreter is that defined in the essential portions of the Revised4 Report on the Algorithmic Language Scheme, with minor constraints and some additions. The Scheme inter- preter is written in Scheme which has then been compiled using the Scheme-to-C compiler, s2cc. OPTIONS
These options are accepted by s2ci. -e Echo text read from the standard input file on the standard output file. -emacs Scheme interpreter is controlled by GNU emacs. -nh Do not print the interpreter version header on the standard output file. -np Do not prompt for input from the standard input file on the standard output file. -q Do not print the result of each expression evaluation. -scgc statflag Enables garbage collection statistics. If set to 1, then garbage collection statistics will be printed. The default is 0, that will result in no statistics. -sch heap Specifies the initial size of the heap in megabytes. The default heap size is 4 MB. The maximum heap size allowed is 1000 MB. -scl percent Specifies the percent of the heap allocated after a generational garbage collection that will force a full collection. The default is 40%. -scm main Specifies the function that should be used instead of the predefined "main". The function name must be entered in the cor- rect case, i.e. letters typically upshifted. -scmh heap Specifies the maximum heap size in megabytes. The default is five times the initial size of the heap. ENVIRONMENT VARIABLES
The items controlled by -sc.. flags can also be controlled by environment variables. If both the flag and the environment variable are provided, then the flag's value will be used. SCGCINFO Controls the reporting of garbage collection statistics to the standard error file. If set to 1, then garbage collection statistics will be printed. The default setting is 0 that will not print the statistics. SCHEAP Specifies the initial size of the heap in megabytes. The default heap size is 4 MB. The maximum heap size allowed is 1000 MB. SCLIMIT Specifies the percent of the heap allocated after a generational garbage collection that will force a full collection. The default is 40%. SCMAXHEAP Specifies the maximum size of the heap in megabytes. The default value is five times the initial heap size. FILES
The interpreter is one a.out file with the name s2ci. All files associated with the interpreter are found in the directory .../scheme- toc/scrt. SEE ALSO
Harold Abelson and Gerald Jay Sussman with Julie Sussman, Structure and Interpretation of Computer Programs, The MIT Press. William Clinger and Jonathan Rees (Editors), Revised4 Report on the Algorithmic Language Scheme, LISP Pointers, Volume IV, Number 3, July- September 1991. PostScript for this report is included in the software distribution. Jerry D. Smith, An Introduction to Scheme, Prentice Hall, Inc. Chapter notes for using this text with Scheme->C are included in the soft- ware distribution. R. Kent Dybvig, The SCHEME Programming Language, Prentice Hall, Inc. Daniel P. Friedman and Matthias Felleisen, The Little LISPer, MIT Press. Joel F. Bartlett, Scheme->C a Portable Scheme-to-C Compiler, WRL Research Report 89/1. Additional documentation is included in the software distribution. s2cc(1) QUESTIONS, COMMENTS, AND COMPLAINTS http://alioth.debian.org/projects/scheme2c/ local S2CI(1)
All times are GMT -4. The time now is 08:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy