Sponsored Content
Full Discussion: Help Me please scripting 101
Top Forums UNIX for Dummies Questions & Answers Help Me please scripting 101 Post 302358558 by pen on Saturday 3rd of October 2009 07:11:56 AM
Old 10-03-2009
Quote:
Originally Posted by ski
Hi, I had to pull a handful of account numbers from a file into a table. Now I want to do a basic list from a directory in my program showing me if any files for these customers exist. There are files associated with each client and need to be processed individually.
$Paytos = 00153301 00153302 00153303 00153304 (=client numbers)

ls -tr ${Paytos}

This would list anything equal to 00153301 00153302 00153303 but I need it to list the following files:
00153301.100109
00153302.100109
00153303.100109

I tried ls -tr ${Paytos}.* but no go?

Thanks.
I'm still not sure I understood you correctly, but given that E contains the extension
Code:
for F in $Paytos; do
  ls ${F}.$E
done

Regards,

pen
 

2 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Daemon 101

I think I have an issue almost like Sammy_T's. I want to make a piece of code run as a daemon. I have some java, along with it 15 classpath's converted to a shell script that I can "runmyjavap". The script is just what I need to run after compiling it: #!/bin/sh java -classpath : ...(from... (3 Replies)
Discussion started by: Miller_K
3 Replies

2. Shell Programming and Scripting

Bash 101 - to (do) ; or not to (do) ; ?

I figured this forum needs some laughs , so I am posting this. And if the answer is - it depends on bash version - do not reply. This is from "manual" while CONTROL-COMMAND; do CONSEQUENT-COMMANDS; done And here is the REAL code - no ";" while do xterm & i=$ done (2 Replies)
Discussion started by: annacreek
2 Replies
userdel(8)						      System Manager's Manual							userdel(8)

NAME
userdel - delete an user account SYNOPSIS
userdel [-D binddn] [-P path] [-r[-f]] [--service service] [--help] [-u] [-v] account DESCRIPTION
userdel deletes an user account from the local system files or a LDAP database and removes all entries that refer to account from the group database. Before the account is removed, the USERDEL_PRECMD command as defined in login.defs(5) is called, after removal the USERDEL_POSTCMD command is called. OPTIONS
-r, --remove-home Remove the whole home directory and the mail spool of the specified account. Files located in other directories will have to be searched for and deleted manually. -f, --force This option is used to force the removal of files, even if not owned by the account. --service service Add the account to a special directory. The default is files, but ldap is also valid. -D, --binddn binddn Use the Distinguished Name binddn to bind to the LDAP directory. The user will be prompted for a password for simple authentica- tion. -P, --path path The passwd and shadow files are located below the specified directory path. chpasswd will use this files, not /etc/passwd and /etc/shadow. --help Print a list of valid options with a short description. -u, --usage Print a short list of valid options. -v, --version Print the version number and exit. FILES
passwd - user account information shadow - shadow user account information group - group information SEE ALSO
passwd(1), login.defs(5), passwd(5), shadow(5), useradd(8), usermod(8) AUTHOR
Thorsten Kukuk <kukuk@suse.de> pwdutils October 2003 userdel(8)
All times are GMT -4. The time now is 08:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy