Search Results

Search: Posts Made By: sethcoop
28,494
Posted By sethcoop
Here is the code to print the number of lines...
Here is the code to print the number of lines below your search... you can change the variable $lines to be how many lines you want to print after the word total.

Hope this helps!
...
2,150
Posted By sethcoop
Are you wanting to make it where say only .txt...
Are you wanting to make it where say only .txt files can be created in a specific directory?
1,837
Posted By sethcoop
I thought I had tried that but i guess I...
I thought I had tried that but i guess I didn't... worked like a charm!!!

Thanks!
1,837
Posted By sethcoop
expand and uuencode...
I have a log file that looks fine when you view it in Unix but when I send it as an attachment to myself it looses its formatting... so I am using "expand" to replace the tabs with spaces and the...
Forum: AIX 10-30-2008
3,994
Posted By sethcoop
I'm not sure about ssh2 but I would assume it is...
I'm not sure about ssh2 but I would assume it is similar to ssh...

check out this post and see if it helps any... ...
Forum: AIX 10-30-2008
6,599
Posted By sethcoop
You can also use your .profile to set these...
You can also use your .profile to set these configurations... also if you need to use a variable or update your path, etc... remember to export the variable...

For example add this to your...
Forum: OS X (Apple) 10-24-2008
4,552
Posted By sethcoop
If it runs when you run it manually but not in...
If it runs when you run it manually but not in cron the first thing that comes to mind is that your environment is different... add this line to the top of your script below the shebang...


....
36,020
Posted By sethcoop
Give this a shot... #!/bin/ksh ...
Give this a shot...


#!/bin/ksh
List=pinglist1.txt

cat $List | while read ip
do

ping -c 2 $ip
rc=$?

if [[ "$rc" = "0" ]]
then
echo "$ip PINGS">>pingresults.txt
...
6,791
Posted By sethcoop
try echo instead of print and also there is not...
try echo instead of print and also there is not space between file = `ba...

it is also probably not best to use the variable "file" since it is a system command...


for all in `find ...
6,791
Posted By sethcoop
I believe it is "basename" not "filename"... ...
I believe it is "basename" not "filename"...

file = `basename $all`
6,791
Posted By sethcoop
Do you want the error files all in the same...
Do you want the error files all in the same directory or should they be somewhere else releative to where the file is located?
Forum: OS X (Apple) 10-24-2008
4,552
Posted By sethcoop
Can you show us the line that is in cron for the...
Can you show us the line that is in cron for the schedule?

Also what does your script do?
36,020
Posted By sethcoop
try echo... echo "$ip PINGS" >>...
try echo...


echo "$ip PINGS" >> pingresults.txt
else
echo "$ip DOESN'T PING" >> pingresults.txt
6,791
Posted By sethcoop
I guess I should have read the title better.... ...
I guess I should have read the title better.... what about something like this?

for all in `find ./ -type f -name "*.log"`
do
grep error $all > ./tmp/$all.error
done
1,814
Posted By sethcoop
it appears that you are looking to "cat" the...
it appears that you are looking to "cat" the files test.txt, uuencode and test.csv.

try this...
cd /location
(cat test.txt; uuencode test.csv test.csv ) | mail -s "test mail" "mail_id"
6,791
Posted By sethcoop
Are all of the log files in the logs directory?? ...
Are all of the log files in the logs directory?? The reason I ask is if they are all in one directory you could do this... if this is not what you want please give more detail.


$ grep error...
12,745
Posted By sethcoop
Generate your keys with the command...
Generate your keys with the command "ssh-keygen".. take all default values... you will see the following and it will create two files for you... the public and private keys...

sethcoop@burn:~$...
96,672
Posted By sethcoop
This will find directories named construction and...
This will find directories named construction and pass them into the script.

for all in `find / -name "construction" -type d -print`
do
/bin/scripttorun.ksh $all
done
12,745
Posted By sethcoop
Is sftp an option? If you use sftp you can just...
Is sftp an option? If you use sftp you can just exchange keys and never have to worry about the password being viewable...
4,083
Posted By sethcoop
what about something like this?? zip -l...
what about something like this??

zip -l <filename> | grep filename.a | awk -F" " '{print $4}'

this will give you your file path...
2,990
Posted By sethcoop
Using "sed" will replace all appearances of...
Using "sed" will replace all appearances of "<sf>" and "</sf>" in your file. Then you can append them together.

Since your data is all on one line then "grep -v" will not work for what you want.
1,928
Posted By sethcoop
What about something like this... ...
What about something like this...

#!/usr/bin/ksh
if [[ $# = 0 ]]
then
find . -type f -size +10k -ls 2>/dev/null
fi
if [[ $# = 1 ]]
then
find . -type f -size +"$1"k -ls 2>/dev/null
fi...
2,990
Posted By sethcoop
If all of the xml is on one line then the grep -v...
If all of the xml is on one line then the grep -v will remove your whole line from the output... since it is all on one line I would use sed to remove the </sf> and <sf> from the files...

$ cat...
Forum: Gentoo 10-22-2008
44,648
Posted By sethcoop
what about "pstree -p"... give that a...
what about "pstree -p"... give that a shot.
39,105
Posted By sethcoop
Without root you can only find out what sudo...
Without root you can only find out what sudo permissions the user you are has... "sudo -l"... if you have root you can check the sudoers file.

Hope this helps...
Showing results 1 to 25 of 34

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