Search Results

Search: Posts Made By: vel4ever
4,866
Posted By pravin27
Try this Perl script-- parse.pl, ...
Try this Perl script-- parse.pl,


#!/usr/bin/perl

use strict;
my $ord_flg;
my $paymnt_flag;
my $str;

open (FH,"<","/path/to/ur/inputxmlfile") || die "can not open file\n";

while...
6,876
Posted By alister
You did it incorrectly. split needs to read from...
You did it incorrectly. split needs to read from standard input (the pipe), so that it can see the result of tr's work, one url per line. Instead of the name of the file with the original data, you...
6,876
Posted By RudiC
No, it does not. Your (unnecessary!) echo...
No, it does not. Your (unnecessary!) echo transforms the painfully achieved newlines to spaces. Why at all do you use echo?

That's true: it does not work. It can't! Remove the urls.txt new from...
6,541
Posted By zaxxon
$ echo "Here is the test string 12233"| awk...
$ echo "Here is the test string 12233"| awk '{print $NF}'
12233
1,952
Posted By itkamaraj
$ cat f.sh #!/bin/bash echo "Shell Script" ...
$ cat f.sh
#!/bin/bash
echo "Shell Script"
exit 1

$ cat f.pl
#!/bin/perl
print "PERL Script";
exit 1;

$ cat g.sh
#!/bin/bash
bash f.sh
wait
perl f.pl
echo "Complete"

$ bash...
1,712
Posted By Scott
What are the permissions on the dir2/master.sh...
What are the permissions on the dir2/master.sh script? Is it executable?

By using . (dot) you are "sourcing" the script into your current environment, and it's run from there. If you want to run...
3,728
Posted By guruprasadpr
Hi That is how dbms_output.put_line works....
Hi

That is how dbms_output.put_line works. it keeps everything in the buffer, and at the end of the procedure, it is flushed out.

You can check with UTL_FILE package wherein you actually...
12,607
Posted By tukuyomi
Another way:~/unix.com$...
Another way:~/unix.com$ d='/root/logs/testing/today/'; echo ${d%/*/}
/root/logs/testing
18,723
Posted By itkamaraj
i missed the / find /root/files -name...
i missed the /


find /root/files -name "*.gz" 2>/dev/null |while read filename; do cp $filename /root/com/$filename`date +%Y%m%d_%H%M%S` ; done
7,352
Posted By jim mcnamara
A date format string works just like the printf...
A date format string works just like the printf (either C or shell printf) format string.


date '+%Y-%m-%dT%T.%N'

Gives you the result you want, the way you did it was correct, but confusing...
2,562
Posted By PikK45
Got the quotes wrong again :( echo...
Got the quotes wrong again :(

echo "\"$(date '+%Y'-'%m'-'%d'T'%T'.'%N')\""
2,562
Posted By zaxxon
Use single quotes: echo '<xml...
Use single quotes:

echo '<xml version="1.0">' >> /root/xml/sample.xml
20,006
Posted By agama
There are other schedulers that are more...
There are other schedulers that are more sophisticated than cron. In this case it sounds like the scheduler of choice provides conditional execution where Job-b depends on the successful execution of...
3,417
Posted By max_hammer
try this ls -ltr...
try this


ls -ltr /root/admin/files/file* | head -1 | awk -F "/" '{print $NF}'


here i have set the field seprator as "/" awk -F "/" and $NF means last field
2,802
Posted By Corona688
( echo "<master>"; cat child1.xml child2.xml ;...
( echo "<master>"; cat child1.xml child2.xml ; echo "</master>" ) > master.xml
8,444
Posted By ygemici
try ........ ./test1.sh && ./test2.sh
try
........
./test1.sh && ./test2.sh
4,232
Posted By ygemici
you can try this ;) # sed -n...
you can try this ;)
# sed -n '/^<url>/s/<[^>]*>//gp' file*.html >>text.txt
# cat text.txt
http://www.google.com
http://www.yahoo.com


regards
ygemici

---------- Post updated at 11:37 AM...
9,312
Posted By frappa
hi, try: find /path/to/dir -type f...
hi,

try:

find /path/to/dir -type f -empty -mmin -60 -print >> /path/to/list.txt
10,134
Posted By Rksiva
If loc2 is same server then use cp, else if its...
If loc2 is same server then use cp, else if its different server then use scp command


cp ${loc1}/file1.txt ${loc2}/test.txt

(or)

scp hostname:${loc1}/file1.txt hostname:${loc2}/test.txt
3,932
Posted By zaxxon
A combination of a while/read loop that takes the...
A combination of a while/read loop that takes the list as input, maybe testing with wget inside and checking it's return code on success or fail.
15,771
Posted By jayan_jay
Use -i option .. $ sed -i '/^$/d' infile
Use -i option ..

$ sed -i '/^$/d' infile
43,972
Posted By Perderabo
Try this: sed '/^ *$/d'
Try this:
sed '/^ *$/d'
286,877
Posted By jayan_jay
@vel4ever , -f will check for the file...
@vel4ever , -f will check for the file existence but -s will check for file existence along with file size greater than 0 (zero)..

If you are checking for the existence of a file which is...
9,945
Posted By ahamed101
file_size=$( stat -c %s /your/file ) if [...
file_size=$( stat -c %s /your/file )
if [ $file_size -gt 10000 ]
then
rm /your/file
fi
--ahamed
174,142
Posted By LivinFree
See the man page for test. if [ -s...
See the man page for test.

if [ -s $file_name ]; then
echo Yay
else
echo Boo
fi

That will Yay if the file exists, and has a size greater than zero, and Boo if the file does not exist, or...
Showing results 1 to 25 of 37

 
All times are GMT -4. The time now is 11:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy