Search Results

Search: Posts Made By: ldapswandog
2,042
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,929
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
11,627
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...
5,385
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
7,111
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...
3,283
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
12,579
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...
8,753
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...
5,054
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,251
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,222
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...
12,375
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 {} \;)...
5,182
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...
5,182
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 {} \;
7,288
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,613
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,749
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,273
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 {} \;)
20,827
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)...
6,178
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
3,691
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,371
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
3,237
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=...
2,083
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
25,761
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

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