10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a script, which is supposed to run 1 day of the month, connect to remote server certain directory, find files, tar the, and copy
find . -ctime -1 | tar -cvf transfer_dmz_start_monthly.tar *${Today}*.*;
if
then
echo "Cannot create a tar file, the terminated... (2 Replies)
Discussion started by: digioleg54
2 Replies
2. UNIX for Beginners Questions & Answers
Hello, sorry to bother anyone reading this
I have an assignment with a question that reads:
Your current directory is stenton. Create empty files called f1, f2, and f12 (in that order), within stenton
So my first thought was to enter: touch f1 f2 f12
but that does not work, does anyone... (1 Reply)
Discussion started by: eleuin
1 Replies
3. UNIX for Beginners Questions & Answers
I am using below code to split files based on blank lines but it does not work.
awk 'BEGIN{i=0}{RS="";}{x="F"++i;}{print > x;}'
Your help would be highly appreciated
find attachment of sample.txt file (2 Replies)
Discussion started by: imranrasheedamu
2 Replies
4. Shell Programming and Scripting
Hi gurus ,
I have two files and i want to perform different action based on the condition if both or either is empty
If
then
Do something
elif
then
do something
elif
then
do something
else
do something
fi
I have tried the below bt its not... (4 Replies)
Discussion started by: r_t_1601
4 Replies
5. Shell Programming and Scripting
I want to check if any file with testing*.txt exists but my script fails if more than 1 file exists. It works fine for a single file
if
then
echo "TEST21"
fi
--------------
bash:
How do I fix this?
Thanks
Please use code tags next time for your code and data. (8 Replies)
Discussion started by: sumang24
8 Replies
6. Shell Programming and Scripting
I have a log directory:
/logs/foo.log
/logs/bar.log
/logs/err.out
I'm trying to find a way to
> /logs/*.log
> /logs/*.out
to blank them out, but of course, that doesn't work.
Any suggestions? (4 Replies)
Discussion started by: Validatorian
4 Replies
7. Shell Programming and Scripting
I would like to empty multiple files contents (without delete the file) which have similar name to begin with.
e.g.
log1.txt
log2.txt
log3.txt
log4.txt
I know cat /dev/null will do the job but that only apply to a single file. But when i tried cat /dev/null > {} \; that doesnt do... (7 Replies)
Discussion started by: kin
7 Replies
8. Shell Programming and Scripting
Hello,
I want to make a script which says if a text file is empty or not.
I tried two ways of making it, but I have problems with both of them.
Now I think that the better way is the ls -s solution (considering that an empty text file has a 0 weight, because "cat file.txt" fails when file is... (4 Replies)
Discussion started by: Link_
4 Replies
9. Shell Programming and Scripting
How do I check if a file is empty in a sh script
I want to test in my shell script if the output file is empty and if it is do one thing and if it isnt empty do another?
any ideas? (8 Replies)
Discussion started by: stolz
8 Replies
10. UNIX for Dummies Questions & Answers
Hi Masters.....
I have problem !!!
I need to check number of records in a file and if it is zero or file is empty i need to do some task.
if ; then
echo "File s empty"
else
echo "Not empty"
fi
so how to check this condition.
I used wc -l < filename.txt => 1 for zero records
same result... (1 Reply)
Discussion started by: shreekrishnagd
1 Replies