06-01-2016
Wildcard in mailx argument
Hi All,
I have to send some files as attachments to an email using mailx copmmand in a shell script.
The files will be generated by some other application everyday with names starting with the literal 'Send' followed by some random sequence of characters in the filenames.
I tried using * wildcard like below:
mailx -a /dir/Send*
user@domain.com
However, while executing the script, it picks up only the first file it finds matching the filename and does not pickup remaining files with the similar name format.
The number of files will be varying every day as like their filenames. Only string common in the filenames will be 'Send' in the beginning. I have to send all the files in the directory matching the filenames Send*
Can anyone please help me out? Thanks in advance.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I'm trying to figure out how to build a small shell script that will find old .shtml files in every /tgp/ directory on the server and delete them if they are older than 10 days...
The structure of the paths are like this:
/home/domains/www.domain2.com/tgp/
/home/domains/www.domain3.com/tgp/... (1 Reply)
Discussion started by: Neko
1 Replies
2. UNIX for Dummies Questions & Answers
In a script , i would like to check if the argument ( $1, $2 inside the script) contain wildcard (*,? etc). how do i do it?
> script_name arg1 arg*
$1 (arg1) does not contain wildcard, but $2 (arg* )contains wildcard. how can i tell in script?
i need to do this is because :
if arg1... (3 Replies)
Discussion started by: gusla
3 Replies
3. UNIX for Dummies Questions & Answers
If I use the "Mail" link instead of the "mail" link to ../mailx I get this error.
Mail so-n-so @whatever.com
mailx: NUL changed to @
Unknown command: "postmaster"
The email still goes through but i get the error.
If I use "mail" it goes thru without the error.
Any ideas?? (2 Replies)
Discussion started by: BG_JrAdmin
2 Replies
4. UNIX for Dummies Questions & Answers
How to find the last argument in a argument line? (4 Replies)
Discussion started by: nehagupta2008
4 Replies
5. Shell Programming and Scripting
Can someone please help me with this SHELL script?
I need to create a script that gets a positive number n as an argument. The script must calculate the factorial of its argument. In other words, it must calculate n!=1x2x3x...xn. Note that 0!=1.
Here is a start but I have no clue how to... (3 Replies)
Discussion started by: I-1
3 Replies
6. Shell Programming and Scripting
Hi All,
Can anyone please provide the command for sending an mail with attachment using mailx command.
Thanks in Advance :)
Regards,
Siram. (3 Replies)
Discussion started by: Sriram.Vedula53
3 Replies
7. Shell Programming and Scripting
If ($argv == “-debug”) then
Echo “in loop”
Endif
But this is not working. If I modify this code and remove “-“, then it works.
Similarly I am getting problem using grep command also
Grep “-debug” Filename
Can someone please help me on how to resolve these... (1 Reply)
Discussion started by: sarbjit
1 Replies
8. UNIX for Advanced & Expert Users
Hi
I allow the user tommy to run this command as root
sudoCommand: /app/appname/connectors/*/*/current/bin/*With "sudo -l" he sees the sudoers, but is unable to execute.
$ sudo /app/appname/connectors/zur/namename/current/bin/othername agentsvc --i --u root --sn 1m7command
Sorry, user... (2 Replies)
Discussion started by: slashdotweenie
2 Replies
9. Shell Programming and Scripting
Hello,
Is there any method thorugh which script can take argument if pass otherwise if argument doesn't pass then it takes the argument from the configuration file
i.e I am workiing on a script which will run through crontab and the script will
chekout the code ,zip and copy to the... (3 Replies)
Discussion started by: rohit22hamirpur
3 Replies
10. UNIX for Advanced & Expert Users
Hi All,
I am running the script
VBoxManage list vms |sed 's/"//g' | cut -d " " -f1 > har1out.mytxt
result=`cat har1out.mytxt | grep $1'
echo $result
echo $1
{
if
then
echo pass
else
echo fail
fi (2 Replies)
Discussion started by: harsha85
2 Replies
umodem(1) General Commands Manual umodem(1)
NAME
umodem - XMODEM-protocol file transfer program
SYNOPSIS
[options] files ...
DESCRIPTION
is a file transfer program that incorporates the well-known XMODEM protocol used on CP/M systems and on the HP 110 portable computer.
Options
recognizes the following options and command-line arguments:
(one) Employ TERM II FTP 1.
Enable TERM FTP 3 (CP/M UG).
Enable 7-bit transfer mask.
Turn on ARPA Net flag.
Enter command mode.
Do not delete
before starting.
(ell) Turn on entry logging.
Allow overwriting of files.
Print all messages.
Receive file.
Specify for text, or for binary.
Send file. Specify for text, or for binary.
Display file status only.
files Name of file or files to be transferred.
WARNINGS
When a binary file is transferred, the target file may have some extra bytes added at the end. This is due to the limitation of the under-
lying protocol.
EXAMPLES
Receive a text file:
Receive a binary file:
Send a text file:
Send a binary file:
AUTHOR
is in the public domain.
SEE ALSO
cu(1), kermit(1), uucp(1).
umodem(1)