Sponsored Content
Top Forums Shell Programming and Scripting How to check if the file exists in directory? Post 302803865 by ken6503 on Tuesday 7th of May 2013 02:58:42 PM
Old 05-07-2013
No, it is not a homework.

I tried list the file then send to tmp file, then using diff to compare. but it doesn't work
ls > tmp
diff tmp filelist
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

check if directory exists

Hi, I need to prompt for a response from a user to enter a path read dest_dir?"Please Enter Directory :" How do I do this until a valid directory is entered by the user. I can use to check the existence of the directory. However when I try the following I cannot get it to work. while ... (2 Replies)
Discussion started by: jerardfjay
2 Replies

2. Shell Programming and Scripting

how to check if masked directory exists?

I'm trying to write a script that identifies whether a directory of the form AWL.????????.IP exists. I have one that exists which is AWL.05301032.IP. When I test like this: If ] I get true, but when I test like this: If ] Or like this If ] Or any other variation of wild cards, I... (4 Replies)
Discussion started by: philplasma
4 Replies

3. UNIX for Dummies Questions & Answers

How can I check if directory exists in a makefile

Hi. I what to write a make file that inside a target I want to check if a directory exists. some like: ### make a: if ;then <command 1> else <command 2> fi ### make end Thanks a lot ---------------------- (2 Replies)
Discussion started by: zivsegal
2 Replies

4. Shell Programming and Scripting

my scripts does not check if directory exists

Hello: Can someone please help me figure out what is wrong here, my script does not move on to the "else" part even though there is no .ssh directory on my remote server: $more putkey.sh #!/bin/ksh for server in `cat list` do if ; then cat $HOME/.ssh/id_rsa.pub |ssh $server ' cat >>... (4 Replies)
Discussion started by: Sara-sh
4 Replies

5. Shell Programming and Scripting

check if a directory exists if not make it

Hey guys im trying to check if the directory exists i get a syntax error on the elif statement iv tried using else and still same result im not sure. If the directory does not exist can i just insert mkdir /tmp/old under the elif once that part gets working if ; then #do nothing elif echo... (20 Replies)
Discussion started by: musicmancanora
20 Replies

6. Shell Programming and Scripting

check if directory and file exists

cp $PATHLOGS/$DATE/*.* $TMP/logs_tmp/ cp $PATHLOGS/$DATE1/*.* $TMP/logs_tmp/ Before copying the files I have to check if the directory $DATE1 and $DATE2 exists. If directory exists then, check if the folder contains some files. if the file exists then, check if the file size is greater... (3 Replies)
Discussion started by: sandy1028
3 Replies

7. Shell Programming and Scripting

How to check if a file exists in a directory?

I want to perform SQL *Loader operation only if a file named "load.txt" exists in a directory "/home/loc/etc". Please help how to check this with a if condition. (8 Replies)
Discussion started by: vel4ever
8 Replies

8. Shell Programming and Scripting

how to check if a directory exists or not.if not need to create it

Hi, I am using solaris 10 OS and bash shell.just checking for small code snippet which follows below. /export/home/vomappservers/spa/common/5.0 /export/home/vomappservers/spa/common/scripts /export/home/vomappservers/spa/tools /export/home/vomappservers/spa/scm5.0/SCCS... (5 Replies)
Discussion started by: muraliinfy04
5 Replies

9. Shell Programming and Scripting

Check whether file exists in directory

Hi guys, I am beginner trying to learn unix. So any help is welcomed. My requirement is to check whether is a file exists in a particular directory or not. The directory path and filename are taken dynamically with user interaction. So the program should continue only if the $filename... (1 Reply)
Discussion started by: maris_markur
1 Replies

10. UNIX for Beginners Questions & Answers

Check that at least one file exists in the directory.

There are some files with suffix dates like abc_20032019.dat abc_17032019.dat If at least one file exists then perform some operation else exit from execution. Korn shell ---------------------------------- array=($inputdir/abc*.dat) If ] ] then echo " file exits" else echo " file does... (10 Replies)
Discussion started by: Rajesh123
10 Replies
BUILDTORRENT(1) 						   User Commands						   BUILDTORRENT(1)

NAME
buildtorrent - a torrent file creation program. SYNOPSIS
buildtorrent [OPTIONS] -a announceurl input output buildtorrent [OPTIONS] -a announceurl -f filelist -n name output DESCRIPTION
buildtorrent is a torrent file creation program. Given an announce url and an input file or directory, buildtorrent generates an output .torrent file that can be used by torrent clients. OPTIONS
-a announce, --announce=url Announce URL (required). -f filelist, --filelist=filelist A text file (or - for standard input) containing a list of files to add to the output torrent file, together with the path to use inside the torrent. One file is given per line, use / as path separator for the torrent path, use | to separate the filesystem path from the torrent path. Backslash can be used to escape newlines and | characters inside names. For example: /data/files/linux.iso|bin/linux.iso /data/files/linux.txt|doc/linux.txt Using this option requires that the --name option be used. -n name, --name=name Specify the name for the torrent. Usage of this option is required when the --filelist option is used, in which case it specifies the name of the torrent directory. Usage without a file list overrides the name of the directory or file given on the command line. -A announces, --announcelist=announces Additional announce URL list. Use , to separate outer level lists, and | to separate inner level items; for example: a,b1|b2,c -w webseeds, --webseeds=webseeds Additional WebSeed URL list. Use , to separate items; for example: a,b,c -l length, --piecelength=length Piece length in bytes (default 262144). -L length, --piecesize=size Use 2^size as piece length (default 18) (overrides -l ). -c comment, --comment=comment User comment (omitted by default). -p private, --private=private Private flag (either 0 or 1). -D, --nodate Omit the creation date field. -C, --nocreator Omit the created by field. -m, --md5sum Add an md5sum field for each file. -s, --show Show generated torrent structure. -S, --showall Show generated torrent structure, including piece data. -q, --quiet Quiet operation with reduced output. -V, --version Show the version string. -h, --help Show a help screen with brief usage information. AUTHORS
Claude Heiland-Allen (claudiusmaximus@goto10.org) SEE ALSO
createtorrent(1), mktorrent(1) http://wiki.theory.org/BitTorrentSpecification http://bittorrent.org/beps/bep_0012.html http://www.getright.com/seedtorrent.html 0.8 January 2010 BUILDTORRENT(1)
All times are GMT -4. The time now is 06:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy