Sponsored Content
Full Discussion: display only file names
Special Forums UNIX and Linux Applications display only file names Post 302153819 by dnat on Thursday 27th of December 2007 01:20:50 AM
Old 12-27-2007
display only file names

Hi,

I want to display only the file names of the ls command with a delimiter of comma.

For example:-

ls /etc/dir/N*

gives the following output

/etc/dir/N1 /etc/dir/N2 /etc/dir/N3

I want the output as N1,N2,N3,-->Here i need the final comma also.

Also, here /etc/dir is being passed as a parameter and hence will be dynamic

Please let me know how we can implement this.

Thanks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Display file names that are being deleted

The print command lists the path of the file being found. I want the output as the file name along with the date that particular files were created i.e similar to a ls -l command. I am using find to list all the files that satisfy the selection criteria and delete them using rm. Can I display... (2 Replies)
Discussion started by: theguy16
2 Replies

2. Shell Programming and Scripting

Reading file names from a file and executing the relative file from shell script

Hi How can i dynamically read files names from a list file and execute them from a single shell script. Please help its urgent Thanks in Advance (4 Replies)
Discussion started by: anushilrai
4 Replies

3. Shell Programming and Scripting

Shell Script to display function names (called & defined) in a C++ Source Code

Hello to all, I am looking for a way to display only the names of function (calls & definition) of a C++ source code.There is already a post related to this, but the script is to find the functions using a specific variable, and the replies are not that convincing since they cannot be used for... (2 Replies)
Discussion started by: frozensmilz
2 Replies

4. Shell Programming and Scripting

Searching for file names in a directory while ignoring certain file names

Sun Solaris Unix Question Haven't been able to find any solution for this situation. Let's just say the file names listed below exist in a directory. I want the find command to find all files in this directory but at the same time I want to eliminate certain file names or files with certain... (2 Replies)
Discussion started by: 2reperry
2 Replies

5. Solaris

using ls -ltr : display only last four file names

Hi , Server details – Machine hardware: sun4u OS version: 5.9 Processor type: sparc Hardware: SUNW,Sun-Fire-880 When I put ls –ltr command I get – /users/testuser> ls -ltr -rw-rw-r-- 1 testuser dba 76 Jan 13 2009 ftp.scr -rwxr-xr-x 1... (6 Replies)
Discussion started by: rahulbahulekar
6 Replies

6. UNIX for Dummies Questions & Answers

How to display only Owner and directory/sub directory names under particular root

hai, I am new to Unix, I have a requirement to display owner name , directory or sub directory name, who's owner name is not equal to "oasitqtc". (here "oasitqtc" is the owner of the directory or sub directory.) i have a command (below) which will display all folders and sub folders, but i... (6 Replies)
Discussion started by: gagan4599
6 Replies

7. Shell Programming and Scripting

How to split a data file into separate files with the file names depending upon a column's value?

Hi, I have a data file xyz.dat similar to the one given below, 2345|98|809||x|969|0 2345|98|809||y|0|537 2345|97|809||x|544|0 2345|97|809||y|0|651 9685|98|809||x|321|0 9685|98|809||y|0|357 9685|98|709||x|687|0 9685|98|709||y|0|234 2315|98|809||x|564|0 2315|98|809||y|0|537... (2 Replies)
Discussion started by: nithins007
2 Replies

8. Shell Programming and Scripting

Split File by Pattern with File Names in Source File... Awk?

Hi all, I'm pretty new to Shell scripting and I need some help to split a source text file into multiple files. The source has a row with pattern where the file needs to be split, and the pattern row also contains the file name of the destination for that specific piece. Here is an example: ... (2 Replies)
Discussion started by: cul8er
2 Replies

9. Shell Programming and Scripting

Change the file name and copy old file content to new file names.

Hi, I have a files in a directory as below :- ls -1 mqdepth-S1STC02 proc-mq-S1STC01 proc-mq-S1STC02 proc-mq-S1STC03 Whereever i have S1STC i need to copy them into new file with file name S2STC. expected output :- ls -1 mqdepth-S2STC02 proc-mq-S2STC01 proc-mq-S2STC02... (3 Replies)
Discussion started by: satishmallidi
3 Replies

10. Shell Programming and Scripting

Exclude certain file names while selectingData files coming in different names in a file name called

Data files coming in different names in a file name called process.txt. 1. shipments_yyyymmdd.gz 2 Order_yyyymmdd.gz 3. Invoice_yyyymmdd.gz 4. globalorder_yyyymmdd.gz The process needs to discard all the below files and only process two of the 4 file names available ... (1 Reply)
Discussion started by: dsravanam
1 Replies
APPLESINGLE(1)						    BSD General Commands Manual 					    APPLESINGLE(1)

NAME
applesingle, binhex, macbinary -- encode and decode files SYNOPSIS
<tool> probe file ... <tool> [decode] [-c] [-fv] [-C dir] [-o outfile] [file ...] <tool> -h | -V applesingle encode [-cfv] [-s suf] [-C dir] [-o outfile] file ... binhex encode [-R] [-cfv] [-s suf] [-C dir] [-o outfile] file ... macbinary encode [-t 1-3] [-cfv] [-s suf] [-C dir] [-o outfile] file ... DESCRIPTION
applesingle, binhex, macbinary are implemented as a single tool with multiple names. All invocations support the three verbs encode, decode, and probe. If multiple files are passed to probe, the exit status will be non-zero only if all files contain data in the specified encoding. OPTIONS
-f, --force perform the operation even if the output file already exists -h, --help display version and usage, then quit -v, --verbose be verbose -V, --version display version, then quit -c, --pipe, --from-stdin, --to-stdout For decode, read encoded data from the standand input. For encode, write encoded data to the standard output. Currently, "plain" data must be written to and from specified filenames (see also mount_fdesc(8)). -C, --directory dir create output files in dir -o, --rename name Use name for output, overriding any stored or default name. For encode, the appropriate suffix will be added to name. -o implies only one file to be encoded or decoded. -s, --suffix .suf override the default suffix for the given encoding -R, --no-runlength-encoding don't use BinHex runlength compression when encoding -t, --type 1-3 Specify MacBinary encoding type. Type 1 is undesirable because it has neither a checksum nor a signature and is thus difficult to recognize. DIAGNOSTICS
In general, the tool returns a non-zero exit status if it fails. Darwin 14 November 2005 Darwin
All times are GMT -4. The time now is 11:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy