Sponsored Content
Top Forums Shell Programming and Scripting How to read those files and output to base? Post 302141779 by radoulov on Monday 22nd of October 2007 09:48:19 AM
Old 10-22-2007
With zsh:
Code:
set -- *unl
for f (${(u)${@%-*}}) print -rl "$f"*>"$f"_all

Otherwise:
Code:
for f in *unl;do printf "%s\n" "$f">>"${f%-*}"_all;done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read multiple log files and create output file and put the result

OS : Linux 2.6.9-67 - Red Hat Enterprise Linux ES release 4 Looking for a script that reads the following log files that gets generated everynight between 2 - 5am Master_App_20090717.log Master_App1_20090717.log Master_App2_20090717.log Master_App3_20090717.log... (2 Replies)
Discussion started by: aavam
2 Replies

2. UNIX for Advanced & Expert Users

read() wont allow me to read files larger than 2 gig (on a 64bit)

Hi the following c-code utilizing the 'read()' man 2 read method cant read in files larger that 2gig. Hi I've found a strange problem on ubuntu64bit, that limits the data you are allowed to allocate on a 64bit platform using the c function 'read()' The following program wont allow to allocate... (14 Replies)
Discussion started by: monkeyking
14 Replies

3. Shell Programming and Scripting

Script to read input and output files and child scripts

I have a directory where i have *.sas; *.pl;*.sh and *.c scripts I need to find out what are the child scripts and input output files for each script: say I have a shell script which calls a perl script and a sas script: In my first line I want I a) the parent script name; b) the... (1 Reply)
Discussion started by: ramky79
1 Replies

4. Shell Programming and Scripting

to read two files, search for patterns and store the output in third file

hello i have two files temp.txt and temp_unique.text the second file consists the unique fields from the temp.txt file the strings stored are in the following form 4,4 17,12 15,65 4,4 14,41 15,65 65,89 1254,1298i'm able to run the following script to get the total count of a... (3 Replies)
Discussion started by: vaibhavkorde
3 Replies

5. Red Hat

CentOS 6.1 base install (like FreeBSD base install)?

Hello, What is the simplest way to install CentOS 6.1 with console base-system only using official LiveDVD image on VirtualBox machine? I'd like to get simplest console with network support like FreeBSD base installation. Then, install services which I need. The installer jest extracts the... (2 Replies)
Discussion started by: newbie_develope
2 Replies

6. Solaris

Move files to another folder base on DU

Hi, I want to move files like *.txt to another filesystem on the same server only when the disk usage reaches 80% or more. But need to keep the latest 5 files. After that delete from the original. How to proceed? Please help Gav... (5 Replies)
Discussion started by: Gavisht
5 Replies

7. Shell Programming and Scripting

Read in 2-column CSV, output many files based on field

Is there a way to read in a two-columned CSV file, and based on the fields in 1st column, output many different files? The input/output looks something like: input.csv: call Call Mom. call Call T-Mobile. go Go home. go Go to school. go Go to gas station. play Play music. play Play... (4 Replies)
Discussion started by: pxalpine
4 Replies

8. Programming

Finding duplicate files in two base directories

Hello All, I have got some assignment to complete till this Monday and problem statement is as follow :- Problem :- Find duplicate files (especially .c and .cpp) from two project base directories with following requirement :- 1.Should be extendable to search in multiple base... (4 Replies)
Discussion started by: anand.shah
4 Replies

9. Shell Programming and Scripting

Combine data from two files base on uniq data

File 1 ID Name Po1 Po2 DD134 DD134_4A_1 NN-1 L_0_1 DD134 DD134_4B_1 NN-2 L_1_1 DD134 DD134_4C_1 NN-3 L_2_1 DD142 DD142_4A_1 NN-1 L_0_1 DD142 DD142_4B_1 NN-2 L_1_1 DD142 DD142_4C_1 NN-3 L_2_1 DD142 DD142_3A_1 NN-41 L_3_1 DD142 DD142_3A_1 NN-42 L_3_2 File 2 ( Combination of... (1 Reply)
Discussion started by: pareshkp
1 Replies

10. UNIX for Dummies Questions & Answers

Read in Multiple log files and output selected variables and values to cvs file

I have several problems with my problems: I hope you can help me. 1) the If else statement I am getting an error message. My syntax must be incorrect because the entire statement is throwing an error. For example in filew.log if these items don't exist Memsize, SASFoundation and also if... (0 Replies)
Discussion started by: dellanicholson
0 Replies
printers(4)							   File Formats 						       printers(4)

NAME
printers - user-configurable printer alias database SYNOPSIS
$HOME/.printers DESCRIPTION
The $HOME/.printers file is a simplified version of the system /etc/printers.conf file. See printers.conf(4). Users create the $HOME/.printers file in their home directory. This optional file is customizable by the user. The $HOME/.printers file performs the following functions: 1. Sets personal aliases for all print commands. 2. Sets the interest list for the lpget, lpstat, and cancel commands. See lpget(1M), lpstat(1) and cancel(1). 3. Sets the default printer for the lp, lpr, lpq, and lprm commands. See lp(1), lpr(1B), lpq(1B), and lprm(1B). Entries Use a line or full screen editor to create or modify the $HOME/.printers file. Each entry in $HOME/.printers describes one destination. Entries are one line consisting of two fields separated by either BLANKs or TABs and terminated by a NEWLINE. Format for an entry in $HOME/.printers varies according to the purpose of the entry. Empty lines can be included for readability. Entries can continue on to multiple lines by adding a backslash (`') as the last character in the line. The $HOME/.printers file can include comments. Comments have a pound sign (`#') as the first character in the line, and are ter- minated by a NEWLINE. Setting Personal Aliases Specify the alias or aliases in the first field. Separate multiple aliases by a pipe sign (`|'). Specify the destination in the second field. A destination names a printer or class of printers, See lpadmin(1M). Specify the destination using atomic, URI-style (scheme://end- point), or POSIX-style (server:destination) names. See printers.conf(4) for information regarding the naming conventions for destination names. Setting the Interest List for lpget, lpstat and cancel Specify _all in the first field. Specify the list of destinations for the interest list in the second field. Separate each destinations by a comma (`,'). Specify destinations using atomic, URI-style (scheme://endpoint), or POSIX-style (server:destination) names. See print- ers.conf(4) for information regarding the naming conventions for destination names. This list of destinations can refer to an alias defined in $HOME/.printers. Setting the Default Destination Specify _default in the first field. Specify the default destination in the second field. Specify the default destination using atomic, URI-style (scheme://endpoint), or POSIX-style (server:destination) names. See printers.conf(4) for information regarding the naming conven- tions for destination names. The default destination can refer to an alias defined in $HOME/.printers. Locating Destination Information The print client commands locate destination information based on the "printers" database entry in the /etc/nsswitch.conf file. See nss- witch.conf(4). Locating the Personal Default Destination The default destination is located differently depending on the command. The lp command locates the default destination in the following order: 1. lp command's -d destination option. 2. LPDEST environment variable. 3. PRINTER environment variable. 4. _default destination in $HOME/.printers. 5. _default destination in /etc/printers.conf. The lpr, lpq, and lprm commands locate the default destination in the following order: 1. lpr command's -P destination option. 2. PRINTER environment variable. 3. LPDEST environment variable. 4. _default destination in $HOME/.printers. 5. _default destination in /etc/printers.conf. Locating the Interest List for lpget, lpstat, and cancel The lpget, lpstat, and cancel commands locate the interest list in the following order: 1. _all list in $HOME/.printers. 2. _all list in /etc/printers.conf. EXAMPLES
Example 1 Setting the Interest List The following entry sets the interest list to destinations ps, secure, and dog at server west and finance_ps: _all ps,secure,west:dog,lpd://server/printers/queue Example 2 Setting Aliases to a Printer The following entry sets the aliases ps, lp, and lw to sparc_printer: ps|lp|lw sparc_printer Example 3 Setting an Alias as a Default Destination The following entry sets the alias pcl to hplj and sets it as the default destination: pcl|_default hplj Example 4 Setting an Alias to a Server Destination The following entry sets the alias secure to destination catalpa at server tabloid: secure tabloid:catalpa Example 5 Setting an Alias to a Site Destination The following entry sets the alias insecure to destination legal_ps using IPP: insecure ipp://server/printers/legal_ps FILES
/etc/printers.conf System printer configuration database $HOME/.printers User-configurable printer database ou=printers LDAP version of /etc/printers.conf printers.conf.byname NIS version of /etc/printers.conf printers.org_dir NIS+ version of /etc/printers.conf ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWpcu | +-----------------------------+-----------------------------+ |Interface Stability |Stable | +-----------------------------+-----------------------------+ SEE ALSO
cancel(1), lp(1), lpq(1B), lpr(1B), lprm(1B), lpstat(1), lpadmin(1M), lpget(1M), nsswitch.conf(4), printers.conf(4), attributes(5), stan- dards(5) System Administration Guide: Basic Administration NOTES
$HOME/.printers is referenced by the printing commands before further name resolution is made in /etc/printers.conf or the name service. If the alias references a destination defined in /etc/printers.conf, it is possible that the destination is defined differently on different systems. This could cause output to be sent to an unintended destination if the user is logged in to a different system. SunOS 5.11 5 Jun 2006 printers(4)
All times are GMT -4. The time now is 11:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy