Sponsored Content
Full Discussion: Please write a script for me
Top Forums UNIX for Beginners Questions & Answers Please write a script for me Post 303029227 by Shubham on Wednesday 23rd of January 2019 01:14:44 PM
Old 01-23-2019
Please write a script for me

Hi All, need one help
Suppose there are two files-
1)Input files-:
Code:
path1/given/to/file | File1
path2/given/to/file | file 2

etc
Note- I use "|" as variable separator.
2) Target files-
I want to fetch data from file1 and use in below command-:
Code:
cd /path(from 1st file)
ls -ltr
If file(From 1st file) present
echo File is present
else
file not present.

same continue for all rows.


Can any one please help me to do this script please.
Moderator's Comments:
Mod Comment Please use CODE tags when displaying sample input, sample output, and code segments (as required by forum rules.

Last edited by Don Cragun; 01-23-2019 at 04:03 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help! Need to write my first script

Hi Folks! I am a MacUser and am trying to learn Unix for the last few months. I will explain in detail what I am trying to do, and apreciate you help if you can teach me even if it is a single comand line inside the script. I own a small company, where I manufacture special gypsums and... (5 Replies)
Discussion started by: fundidor
5 Replies

2. Shell Programming and Scripting

Help me to write the script

Actually i am working with two diffrent files having same structure each file contain Ten diffrent column and i want to write a script which will compare the colummns of first file with the column of second file and diiference will be send to the first column of third file . similarly for... (5 Replies)
Discussion started by: gyana_cboy
5 Replies

3. Shell Programming and Scripting

Please write this script for me

UNIX shell script (Bourne shell syntax) called admin_script. This script is described below as a usage summary: admin_script Note: if no options are specified, a menu is displayed which allows users to perform one of the following tasks and then exit. If incorrect options are provided,... (1 Reply)
Discussion started by: nadman123
1 Replies

4. UNIX for Dummies Questions & Answers

Should I write a PERL Script or Shell Script?

Hello, I have done some BASIC shell scripting/PERL scripting before so I am familiar with the languages. I am not really sure which one would lend itself better to the application I have to write. I am required to scan the message logs for possible break in attempts. If I use shell scripting... (2 Replies)
Discussion started by: mojoman
2 Replies

5. Shell Programming and Scripting

Better way to write this script

Hi All, I have written the following script. I have just repeated some commands, and I am sure there is a more better way to do it. I hope I one of gurus here will help me make it in a better shape. Here is the script: #! /bin/sh sed -i -e "s/test2.xxx/test3.xxx/" -e "s/output2/output3/"... (2 Replies)
Discussion started by: faizlo
2 Replies

6. Shell Programming and Scripting

Script Help - Another Way To Write This

I am adapting an Open Step ping server script to Ubuntu 8.10 and one section of my script isn't working # if there are servers that just went down or came back up, notify # with high importance if ; then echo notifying of servers that are up again or just now down notify high # if there... (2 Replies)
Discussion started by: gbxfan
2 Replies

7. AIX

how to write this script?

If I need delete some disk, for i in hdisk1 hdisk2 hdisk3 hdisk4 do rmdev -dl $i done if I have more than 100 hdisks, how to write a script like that to delete them? (6 Replies)
Discussion started by: rainbow_bean
6 Replies

8. Shell Programming and Scripting

Q: How to write this script?

Hi there :rolleyes: I have a folder called backup it is path is: ~/backup Inside this folder, there are four files: ~/backup/test1.cpp ~/backup/test2.cpp ~/backup/test3.cpp ~/backup/PATHS.TXT The fourth file PATHS.TXT contains the original paths for the three files. This is the... (4 Replies)
Discussion started by: domain
4 Replies

9. IP Networking

read/write,write/write lock with smbclient fails

Hi, We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies

10. Shell Programming and Scripting

Please help me to write the script

Hi All, I have written the follwing script to take the backup of the file every day along with the date. DATE=`date +%Y%m%d` export DATE cp var/hr/hr333m.txt cp var/hr/payments/hr333m_$DATE.txt The file name as follows after taking the backup. hr333m_20110630.txt Could you... (3 Replies)
Discussion started by: ajaykumarkona
3 Replies
tarsets(1)						      General Commands Manual							tarsets(1)

Name
       tarsets - subset kitting command file generator

Syntax
       /usr/sys/dist/tarsets [ -d ] pathname

Arguments
       pathname

       Specify the root directory for the file hierarchy containing the files to be kitted in the subset.

Description
       The  command  reads subset inventory records from standard input and writes a command procedure to standard output.  This command procedure
       contains the commands required to create subset images for the subset described in the input.

       The command is used by the utility to produce software kits for use with the utility.

       All error diagnostics are written to the file stderr in the current directory.

Options
       -d     Enable debugging. Debug trace diagnostics are written to ts.dbg in the current directory.

Restrictions
       The output command procedure produces multiple tar files.  Each tar file has a goal size of 400Kb. This is an anachronism from the days	of
       software  distribution  on RX50 diskettes.  The command procedure is modified automatically to produce a single subset image when is called
       from the utility.

Return Values
       The exit status from the command is zero unless a hard link referenced in the input inventory cannot be found in the  input  inventory,	in
       which case the status is 1.

Diagnostics
       Invalid Record on line n
	      The input record on line n is not in subset inventory format.

       path1 -> path2 link reference unresolved.
	      The  input record for path1 contains a pointer to path2 in the referent field and path2 does not appear in the inventory. This indi-
	      cates that path2 was deleted from the inventory after being created by the invcutter command.

       Warning: file filename is n blocks too large for diskette
	      This is an obsolete message. It can be ignored.

       Writing Oversized File Volume...
	      This is an obsolete message. It can be ignored.

       i Blocks, j Chars on Volume k
	      This is an informational message. The number j is the number of characters in the command written to the output to produce volume k.

Files
       stderr Diagnostic output.

       ts.dbg Debug diagnostic output.

See Also
       invcutter(1), kits(1), stl_inv(5), setld(8)
       Guide to Preparing Software for Distribution on ULTRIX Systems

																	tarsets(1)
All times are GMT -4. The time now is 08:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy