I've been stuck with this for a few days now , so I'm hoping someone out there might be kind enough to help me.
I need to do a "file exist" check with a variable in the file name. After that I need to do a line count on the file, and output its results to a txt file.
For simplicity/compliance reasons, I have simplified all my paths and file names. Also the txt file has already been created, hence the ">>" instead of ">"
Right now I'm getting a "bad substitute" error for the first line "if [ -f "/path/File_${CUR_DATE).rtf" ]; then" in the code below.
Code:
Please someone grace me with their expertise, it is very much appreciated!
Best regards,
Jay
Last edited by Franklin52; 10-24-2012 at 03:55 AM..
Reason: Please use code tags for data and code samples
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
Hi,
I've modified the syslogd source to include a thread that will keep track of a timer(or a timer thread). My intention is to check the file size of /var/log/messages in every one minute & if the size is more than 128KB, do a echo " " > /var/log/messages, so that the file size will be set... (7 Replies)
I'm trying to make use of mkdir(char *pathname, S_IRWXU) to create the directories.
but it only creates one directory at a time. so I have to separate the tokens for "/home/blah1/blah2/blah3" as "home blah1 blah2 blah3" using delimiter "/", but it is again hectic to create such directory... (8 Replies)
Hello fellow UNIX fans,
I'm running AIX 4.3 and getting an error message “cp: /a/file2.db: A file or directory in the path does not exist” when I run the following command:
cp /b/file.db /a/file2.db
It stops every time about 95% of the way through the copy process at 1,073,741,312 bits. ... (3 Replies)
Hi all,
First off, sorry for a long post but I think I have no other option if I need to explain properly what I need help for.
I need some advise on how best to check for "faulty" or "stalled/jammed' print queues. At the moment, I have three (3) application servers which also acts as print... (0 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Hello,
I have been working on Awk/sed one liner which counts the number of occurrences of '|' in pipe separated lines of file and delete the line from files if count exceeds "17".
i.e need to get records having exact 17 pipe separated fields(no more or less)
currently i have below :
awk... (1 Reply)
Hi everybody,
I am new at Unix/Bourne shell scripting and with my youngest experiences, I will not become very old with it :o
My code:
#!/bin/sh
set -e
set -u
export IFS=
optl="Optl"
LOCSTORCLI="/opt/lsi/storcli/storcli"
($LOCSTORCLI /c0 /vall show | grep RAID | cut -d " "... (5 Replies)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
LEARN ABOUT DEBIAN
rdup-up
RDUP-UP(1) rdup RDUP-UP(1)NAME
rdup-up - update a directory tree with a rdup archive
SYNOPSIS
rdup-up [OPTION]... DIRECTORY
DESCRIPTION
With rdup-up you can update an (possibly) existing directory structure with a rdup archive.
The rdup archive has to be given to rdup-up's standard input.
Username and uids
rdup outputs both the username and uid, the receiving system (which may be a totally different system) checks if the username and uid
match. If the username and uid don't match the (numeric) uid is used on the file. The same holds true for the groupname and gid.
OPTIONS -n Do a dry-run and do not create anything on disk.
-t Create DIRECTORY (ala mkdir -p) if it does not exist.
-s N Strip N path components from a pathname. If the resulting pathname is empty after this operation it is skipped. Be careful however
with the following structure:
/foo
/foo/bar
/foo/bar/bla.txt
/foo/blork/bla.txt
With rdup-up -s2 this will leave:
<empty>
<empty>
/bla.txt
/bla.txt
And the last 'bla.txt' will overwrite the previous one, this will happen without warnings.
-r PATH
This option is related to the -s option, but works different. The string PATH is removed from (the beginning of) each pathname. With
-r /home/backup the pathname /home/backup/bin/mycmd becomes /bin/mycmd. The same could be done with -s 2, but then you need to count
the slashes. Note -s is always performed before -r.
-v Be more verbose and echo the processed files to standard output.
-vv Be even more verbose and echo processed file and the uid and gid information to standard output.
-T Show a table of contents of the rdup stream received (ala tar -tf -). With -T the directory argument is optional. -T unsets any
verbose (-v) options.
-h A short help message.
-V Show the version.
EXIT CODE
rdup-up return a zero exit code on success, otherwise 1 is returned.
AUTHOR
Written by Miek Gieben.
REPORTING BUGS
Report bugs to <miek@miek.nl>.
SEE ALSO
http:/www.miek.nl/projects/rdup/ is the main site of rdup. Also see rdup(1), rdup-tr(1) and rdup-backups(7).
COPYRIGHT
Copyright (C) 2005-2010 Miek Gieben. This is free software. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
Licensed under the GPL version 3. See the file LICENSE in the source distribution of rdup.
1.1.11 13 Dec 2008 RDUP-UP(1)