Sponsored Content
Top Forums Shell Programming and Scripting Logic to separate the first name in the file Post 302999500 by ricky-row on Wednesday 21st of June 2017 12:49:45 PM
Old 06-21-2017
But my requirement is to look for a file in the location and if not has to create it first, if it is available I have to append these values in the end of the file. in different format, not directly.
like
ex
after the 1st function, I will be getting output as abc.list, xyz.list, cd-ef.list, gfd.list in a directoy named info.

apart from this output I need another file, let it be the same name you mentioned as outputfile. In this output file.
If I open the file it should have.
Code:
NAME= abc
TYPE=doc
NAME=xyz
TYPE=doc
NAME=cd-ef
TYPE=doc
NAME=gfd
TYPE=doc

here TPYE can be hardcoded.

Sorry to trouble, As, I am a newbee, I am struggling a lot.
 

We Also Found This Discussion For You

1. Shell Programming and Scripting

Shell script (sh file) logic to compare contents of one file with another file and output to file

Shell script logic Hi I have 2 input files like with file 1 content as (file1) "BRGTEST-242" a.txt "BRGTEST-240" a.txt "BRGTEST-219" e.txt File 2 contents as fle(2) "BRGTEST-244" a.txt "BRGTEST-244" b.txt "BRGTEST-231" c.txt "BRGTEST-231" d.txt "BRGTEST-221" e.txt I want to get... (22 Replies)
Discussion started by: pottic
22 Replies
CHSH(1)                                                            User Commands                                                           CHSH(1)

NAME
chsh - change login shell SYNOPSIS
chsh [options] [LOGIN] DESCRIPTION
The chsh command changes the user login shell. This determines the name of the user's initial login command. A normal user may only change the login shell for her own account; the superuser may change the login shell for any account. OPTIONS
The options which apply to the chsh command are: -h, --help Display help message and exit. -R, --root CHROOT_DIR Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory. -s, --shell SHELL The name of the user's new login shell. Setting this field to blank causes the system to select the default login shell. If the -s option is not selected, chsh operates in an interactive fashion, prompting the user with the current login shell. Enter the new value to change the shell, or leave the line blank to use the current one. The current shell is displayed between a pair of [ ] marks. NOTE
The only restriction placed on the login shell is that the command name must be listed in /etc/shells, unless the invoker is the superuser, and then any value may be added. An account with a restricted login shell may not change her login shell. For this reason, placing /bin/rsh in /etc/shells is discouraged since accidentally changing to a restricted shell would prevent the user from ever changing her login shell back to its original value. FILES
/etc/passwd User account information. /etc/shells List of valid login shells. /etc/login.defs Shadow password suite configuration. SEE ALSO
chfn(1), login.defs(5), passwd(5). shadow-utils 4.5 01/25/2018 CHSH(1)
All times are GMT -4. The time now is 10:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy