Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: ldapswandog
1,774
Posted By ldapswandog
Not the best solution I'm sure ... curl -s...
Not the best solution I'm sure ...

curl -s http://www.tidetimes.org.uk/southampton-tide-times.rss | grep description | sed -n "s/.*\([0-9][0-9]:[0-9][0-9]\)/\1/;s/\([0-9][0-9]:[0-9][0-9]\).*$/\1/p"
1,684
Posted By ldapswandog
To get each line separately you need to 'read'...
To get each line separately you need to 'read' each line from the variable

for dir in "`find ./ -type d`";do
echo "$dir" | while read line; do
echo "Found: $line ,yeah!"
done
done
8,899
Posted By ldapswandog
Here is a quick solution #!/bin/ksh ...
Here is a quick solution


#!/bin/ksh
#set -vx
# # set counter for detecting the script
typeset -i script_count=0

# # set loop count for 24 hours, change as needed
typeset -i...
4,585
Posted By ldapswandog
Maybe this is what your looking for... grep...
Maybe this is what your looking for...

grep "^[&?s]*ession.id=[a-f0-9]*" file
6,291
Posted By ldapswandog
Each time you run your backup use 'touch' to...
Each time you run your backup use 'touch' to create a file called backup_complete.txt, then the next time you go to backup you can use find to backup all the updated and new files.

find . -newer...
2,306
Posted By ldapswandog
Here is a quick solution to get the line with the...
Here is a quick solution to get the line with the file and completion time.

sed -n '/^\//N;s/\n.*$/ /p;/^Process /s/^.* \([0-9]\)/\1/p' file
10,317
Posted By ldapswandog
I'm with kshji the script most likely has an...
I'm with kshji the script most likely has an unmatched quoted pair. The easy way to find this is to download an editor that understands shell script. I use 'jedit' on my pc and copy any scripts I'm...
7,946
Posted By ldapswandog
Open the association file and split each line...
Open the association file and split each line into an array using 'tab' as the delimiter. Starting with array element @_[2] on each line, open the referenced file and do work, then write the output...
4,440
Posted By ldapswandog
I have not tried to execute a command within the...
I have not tried to execute a command within the subject line but often include variables. You can try executing the command using "`" back ticks like;

ls -otrg|awk '{print $4 " " $5 " "$6 "...
2,059
Posted By ldapswandog
The 'sed' line replaces the first 4 numbers on a...
The 'sed' line replaces the first 4 numbers on a line with '/www/repository/<first_4_num>/<first_4_num> and so has no dependency on case. The for loop copies each full path including the file name,...
2,059
Posted By ldapswandog
I would add the path and file type flags and if...
I would add the path and file type flags and if you want long format you will need to add exec as well. You should also validate that the files your trying to find have permissions 775, because the...
11,592
Posted By ldapswandog
Here is a solution that does not require you to...
Here is a solution that does not require you to build a list of file names first. If you have a set of file types like; *.txt, *.sh etc.

for x in $(find . -name "*.txt" -exec grep -l HELLO {} \;)...
4,392
Posted By ldapswandog
Help yourself some here, check the man page for...
Help yourself some here, check the man page for the 'find' command. the 'cmin' argument is looking at last_changed_time and what ever process is putting the file in the directory may be keeping it's...
4,392
Posted By ldapswandog
try this... find ./ -name <your_file_name>...
try this...

find ./ -name <your_file_name> -cmin +30 -maxdepth 1 -exec mailx -s "file 30 minutes old" you@mail.com {} \;
6,472
Posted By ldapswandog
Based on your description where file1 has the...
Based on your description where file1 has the original columns

sed -n '2,$p' file1 | awk '{ print NR" "$0 }' > file2
3,302
Posted By ldapswandog
you call the function and pass arguments to it by...
you call the function and pass arguments to it by

function get_param ()
{
arg1="$1"
arg2="$2"
test="`date`"
test2="someother string"
#export test test2
}

echo "before function get_param...
3,569
Posted By ldapswandog
Some one who knows AWK will provide a much better...
Some one who knows AWK will provide a much better solution, but I can at least provide a solution.

# # get the list of duplicates in column 2
awk '{print $2}' file | sort | uniq -c | sort -n |...
3,001
Posted By ldapswandog
By using the 'find' command you can find files...
By using the 'find' command you can find files even in sub directories

ls -l $(find . -name "811_Intermediate_File_*" -exec grep -l 4400276302 {} \;)
18,488
Posted By ldapswandog
You can use 'trap' within the parent script to...
You can use 'trap' within the parent script to capture signals and perform commands before exiting.

$ trap -l
1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL
5) SIGTRAP 6)...
5,184
Posted By ldapswandog
This will replace the space after .com .net or...
This will replace the space after .com .net or .org with a pipe.

sed '/req.http.host/s/\([com|net|org]\) /\1|/g' file
2,950
Posted By ldapswandog
Not as graceful as awk but it works sed -n...
Not as graceful as awk but it works

sed -n -e '/^[0-9]/s/ *//gp' file | sed 's/red/red /' | sort -u

Look for all lines beginning with a number and remove all spaces
Look for lines with word...
2,160
Posted By ldapswandog
You can get the date and time variables then...
You can get the date and time variables then extract what you want using sed

var_time=$(date '+%m/%d/20%y %k')
sed -n "/^Starting.*$var_time/,/^$/p" file
2,607
Posted By ldapswandog
You should be able to use the app srvrs built in...
You should be able to use the app srvrs built in startup feature

asadmin start-domain --user admin --passwordfile

WHERE --passwordfile is $HOME/.asadminpassword
contents=...
1,834
Posted By ldapswandog
Maybe this is what your looking for... ...
Maybe this is what your looking for...

#!/bin/ksh

typeset -i record_cnt=$(grep -c "ENDC.*$sysDate" file1)
if (( $record_cnt > 0 )); then
execute_script.sh
fi
23,903
Posted By ldapswandog
I use regular expressions in Expect and by using...
I use regular expressions in Expect and by using the wild card am able to match everything in the buffer up to the '$' prompt.

expect -re ".*\$" {
send_user "HI\n";
send "\r";
}
Showing results 1 to 25 of 131

 

Featured Tech Videos

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