Sponsored Content
Top Forums Shell Programming and Scripting How to read each line from input file, assign variables, and echo to output file? Post 302893357 by Scottie1954 on Tuesday 18th of March 2014 06:30:19 PM
Old 03-18-2014
Thanks, Jedi Master and Chubler_XL. Both answers worked.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Awk/shell question: Read from file and assign to variables.

Is anyone able to help with writing a program that will do the following: 1. Read the contents of a file, line by line, and on each line, assign each of the two columns to a shell variable. 2. perform an action on the variables 3. Read the next line. Here is what I've gotten so far. ... (3 Replies)
Discussion started by: akbar
3 Replies

2. Shell Programming and Scripting

how can i read text file and assign its values to variables using shell

Hello, I have a cat.dat file, i would like shell to read each 3 lines and set this 3 lines to 3 different variables. my cat.dat is: 11 12 +380486461001 12 13 +380486461002 13 14 +380486461003 i want shell to make a loop and assign 1st line to student_id, 2nd line to... (4 Replies)
Discussion started by: rosalinda
4 Replies

3. Shell Programming and Scripting

How to read a file and assign variables to data?

Hi, I need a simple csh script to read a file containing data like this Buy Transactions : 175 Sell Transactions : 212 Server: sepo2 i want to read both field and its value and assign variables to each.. (2 Replies)
Discussion started by: pravsripad
2 Replies

4. Shell Programming and Scripting

Read file and for each line replace two variables, add strings and save output in another file

Hi All, I have a file, let's call it "info.tmp" that contains data like this .. ABC123456 PCX333445 BCD789833 I need to read "info.tmp" and for each line add strings in a way that the final output is put /logs/ua/dummy.trigger 'AAA00001.FTP.XXX.BLA03A01.xxxxxx(+1)' where XXX... (5 Replies)
Discussion started by: Andy_ARG
5 Replies

5. Shell Programming and Scripting

Read record from the text file & assign those values to variables in the script

For eg: I have sample.txt file with 4 rows of record like: user1|password1 user2|password2 user3|password3 user4|password4 The username and password is sepsrated by '|' I want to get the 1st row value from the file and assign it to two different variables(username and password) in my... (1 Reply)
Discussion started by: priya001
1 Replies

6. Shell Programming and Scripting

Read file from input and redirect to output file

Hi , i am having an file which contains 5 file_name data, i need to read the file name and will perform certain operation and generate out file names with named as 5 individual file_names for eg: file.txt contains file_name1.txt|hai file_name2.txt|bye file_name3.txt|how... (3 Replies)
Discussion started by: rohit_shinez
3 Replies

7. Shell Programming and Scripting

Read record from the text file contain multiple separated values & assign those values to variables

I have a file containing multiple values, some of them are pipe separated which are to be read as separate values and some of them are single value all are these need to store in variables. I need to read this file which is an input to my script Config.txt file name, first path, second... (7 Replies)
Discussion started by: ketanraut
7 Replies

8. Shell Programming and Scripting

Do While Loop + Read From File + assign line to a variable

Hello, I am using below code for reading from a file and assigning the values to a variable , but it is loosing the value after the loop , please suggest to retain the value of the variable after the loop , while IFS=: read -r line do set $dsc=$line echo 'printing line variable ' $line... (1 Reply)
Discussion started by: ParthThakkar
1 Replies

9. Shell Programming and Scripting

ksh - Read input from file and output CSV i same row

Hello I have the following output and want the output to look: FROM: GigabitEthernet0/0 is up, line protocol is up 1 input errors, 0 CRC, 0 frame, 1 overrun, 0 ignored 275 output errors, 0 collisions, 3 interface resets GigabitEthernet0/1 is up, line protocol is up 0... (4 Replies)
Discussion started by: JayJay2018
4 Replies

10. UNIX for Beginners Questions & Answers

How To Read a File and Assign the line values to an Array?

i have this basic code that i wrote to read a file and place it's values to an array. the source/input file will have multiple strings on it that is separated by a whitespace. sample_list.txt file contents: ACCT1 TABLE1 ACCT2 TABLE2 ACCT3 TABLE3 script file: sample_list.sh ... (3 Replies)
Discussion started by: wtolentino
3 Replies
QSTAT(1)							   User Commands							  QSTAT(1)

NAME
qstat - Tool for querying gaming servers SYNOPSIS
qstat [options ...] [-default server-type] [-cfg file] [-f file] [host[:port]] ... Where host is an IP address or host name DESCRIPTION
Qstat provides a simple interface for querying servers for a number of games, including but not limited to quake, quakeworld, quake2, quake3arena, unreal tournament or half-life. For servers running a game, the server name, map name, current number of players, and response time are displayed. Server rules and player information may also be displayed. OPTIONS
-a2s query Half-Life 2 new server -ams query America's Army v2.x server -bfs query BFRIS server -d3g query Descent3 Gamespy Protocol server -d3m query Descent3 Master (PXO) server -d3p query Descent3 PXO protocol server -d3s query Descent3 server -dm3m query Doom 3 Master server -dm3s query Doom 3 server -efm query Star Trek: Elite Force server -efs query Star Trek: Elite Force server -eye query All Seeing Eye Protocol server -fcs query FarCry server -gps query Gamespy Protocol server -grs query Ghost Recon server -gs2 query Gamespy V2 Protocol server -gs3 query Gamespy V3 Protocol server -gs4 query Gamespy V4 Protocol server -gsm query Gamespy Master server -h2s query Hexen II server -hl2s query Half-Life 2 server -hlm query Half-Life Master server -hls query Half-Life server -hrs query Heretic II server -hws query HexenWorld server -jk3m query Jedi Knight: Jedi Academy server -jk3s query Jedi Knight: Jedi Academy server -kps query Kingpin server -preys query PREY server -prs query Pariah server -q2m query Quake II Master server -q2s query Quake II server -q3m query Quake III Master server -q3s query Quake III: Arena server -q4m query Quake 4 Master server -q4s query Quake 4 server -qs query Quake server -qwm query QuakeWorld Master server -qws query QuakeWorld server -rss query Ravenshield server -rwm query Return to Castle Wolfenstein Master server -rws query Return to Castle Wolfenstein server -sas query Savage server -sfs query Soldier of Fortune server -sgs query Shogo: Mobile Armor Division server -sns query Sin server -stm query Steam Master server -t2m query Tribes 2 Master server -t2s query Tribes 2 server -tbm query Tribes Master server -tbs query Tribes server -tm query TrackMania server -ts2 query Teamspeak 2 server -uns query Unreal server -ut2004m query UT2004 Master server -ut2s query Unreal Tournament 2003 server -default set default server type: a2s ams bfs d3g d3m d3p d3s dm3m dm3s efm efs eye fcs gps grs gs2 gs3 gs4 gsm h2s hl2s hlm hls hrs hws jk3m jk3s kps preys prs q2m q2s q3m q3s q4m q4s qs qwm qws rss rwm rws sas sfs sgs sns stm t2m t2s tbm tbs tm ts2 uns ut2004m ut2s -nocfg Ignore qstat configuration loaded from any default location. Must be the first option on the command-line. -cfg read the extended types from given file not the default one -f read hosts from file -R fetch and display server rules -P fetch and display player info -sort sort servers and/or players -u only display servers that are up -nf do not display full servers -ne do not display empty servers -nh do not display header line. -cn display color names instead of numbers -ncn display color numbers instead of names -hc display colors in #rrggbb format -tc display time in clock format (DhDDmDDs) -tsw display time in stop-watch format (DD:DD:DD) -ts display time in seconds -pa display player address -hpn display player names in hex -hsn display server names in hex -nh do not display header -old old style display -progress display progress meter (text only) -retry number of retries, default is 3 -interval interval between retries, default is 0.50 seconds -mi interval between master server retries, default is 2.00 seconds -timeout total time in seconds before giving up -maxsim set maximum simultaneous queries -sendinterval set time in ms between sending packets, default 5 -errors display errors -allowserverdups allow adding multiple servers with same ip:port (needed for ts2) -of output file -af Like -of, but append to the file -raw <delim> output in raw format using <delim> as delimiter -mdelim <delim> For rules with multi values use <delim> as delimiter -xml output status data as an XML document -Th, -Ts, -Tpt output templates: header, server and player -Tr, -Tt output templates: rule, and trailer -srcport <range> Send packets from these network ports -srcip <IP> Send packets using this IP address -H resolve host names -Hcache <file> host name cache file -carets Display carets in Quake 3 player names -d Enable debug options. Specify multiple times to increase debug level -dump write received raw packets to dumpNNN files which must not exist before -pkt <file> use file as server reply instead of querying the server. Works only with TF_SINGLE_QUERY servers -htmlmode Convert <, >, and & to the equivalent HTML entities -htmlnames Colorize Quake 3 and Tribes 2 player names using html font tags -nohtmlnames Do not colorize Quake 3 and Tribes 2 player names even if $HTML is used in an output template -showgameport Always display the game port in QStat output -noportoffset Do not use builtin status port offsets (assume query port was specified) -raw-arg When used with -raw, always display the server address as it appeared in a file or on the command-line -utf8 Use the UTF-8 character encoding for XML output. Sort keys: servers: p=by-ping, g=by-game, i=by-IP-address, h=by-hostname, n=by-#-players, l=by-list-order players: P=by-ping, F=by-frags, T=by-team, N=by-name This manpage describes qstat version 2.11. SEE ALSO
/usr/share/doc/qstat/qstatdoc.html AUTHOR
This manual page was originally written by Jordi Mallach <jordi@debian.org>, for the Debian system and is distributed under the same licence as Qstat itself. qstat June 2010 QSTAT(1)
All times are GMT -4. The time now is 12:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy