Search Results

Search: Posts Made By: Cochise
5,573
Posted By Cochise
Thanks to bakunin for his interesting lecture on...
Thanks to bakunin for his interesting lecture on piping commands to ksh.

And thanks to MadeInGermany for converting the sed command to non-GNU syntax.
I love short and straight forward code...
5,573
Posted By Cochise
Thank you. Brilliant solution, unfortunately sed...
Thank you. Brilliant solution, unfortunately sed in ksh does not know the -r option. How could that sed command look instead? I'm trying now quite a while without success.
5,573
Posted By Cochise
For better understanding of my problem, here is...
For better understanding of my problem, here is the long story:

I have a large log file, that has some lines like this:
skipping: /usr/bin/chuser "gecos=ipsec;MDE0M819;;F" ipsec (TESTMODE)...
5,573
Posted By Cochise
??? ... that's not what I asked for. Was I that...
??? ... that's not what I asked for. Was I that unclear?
5,573
Posted By Cochise
Ksh: run commands from pipe
I create commands within a pipe and finally want them to be executed instead of being displayed on the screen. What is the last stage in this pipe? I found by guessing that "ksh" is working, but is...
1,353
Posted By Cochise
Thank you Scrutinizer and Corona688. printf...
Thank you Scrutinizer and Corona688.

printf "%s\n" "${some_arbitary_varible}"... does the trick.

Btw,
print -r "${some_arbitary_varible}"does the same in ksh.

Is there any special reason...
1,353
Posted By Cochise
Sorry for the late response, shell shock kept me...
Sorry for the late response, shell shock kept me busy the past days.

I found the problem: \n is interpreted as newline, so a line in the file like ...
...
Forum: Cybersecurity 09-26-2014
3,331
Posted By Cochise
Sorry, I'm not familiar with bourne or bash, I'm...
Sorry, I'm not familiar with bourne or bash, I'm a Korny :-)
Forum: Cybersecurity 09-26-2014
3,331
Posted By Cochise
'Shell Shock' vulnerability in Bourne shell
A severe vulnerability was discovered in Bourne shell.

Just google for: bash vulnerability
... for more details.
17,551
Posted By Cochise
Thanks, but do bash scripts necessarily end with...
Thanks, but do bash scripts necessarily end with .sh ?

What I came up with by now is:

find / -type f \( -perm -u=x -o -perm -g=x -o -perm -o=x \) -exec grep "^#!.*/bash" {} /dev/null \;|tee...
17,551
Posted By Cochise
I'm looking for bash scripts only.
I'm looking for bash scripts only.
17,551
Posted By Cochise
Find all bash scripts on system
I want to find all bash scripts on my system.
What I have so far is this:

find / -type f \( -perm -u=x -o -perm -g=x -o -perm -o=x \) | xargs -I{} head -1 {} |grep bashThis will find all...
1,353
Posted By Cochise
Changed script: do n=$(($i*100)) ...
Changed script:

do
n=$(($i*100))
echo "Trying $n records:"
head -$n error.log | wc
recs=$(head -$n error.log)
echo "$recs" | wc
done

New output:
Trying 100 records:
100 ...
1,353
Posted By Cochise
Strange Phenomena with records filed in variable
Trying to find out whether there is a limit for the number of records that can be stored in a variable I set up this small script:

#!/usr/bin/ksh
for ((i = 1; i < 21; i++))
do
...
2,270
Posted By Cochise
Outch, sorry Makarand, I missed that small...
Outch, sorry Makarand, I missed that small difference the double quotes make around the variable.
Thanks (from Germany), also to "Made in Germany" for pointing that out.

Makarand's solution can...
2,270
Posted By Cochise
Thanks, but the result from grep may have...
Thanks, but the result from grep may have multiple lines, that will be clutched together when stored in one variable.
2,018
Posted By Cochise
Thanks for pointing this out. To make this...
Thanks for pointing this out.

To make this complete, the ksh variant would be:
read line?"Who are you: "
echo "Hi ${line:=Kim}"Are programmers still paid for number of lines of code?
2,018
Posted By Cochise
Could be even shorter: read -p "Who are you: "...
Could be even shorter:
read -p "Who are you: " line
echo "Hi ${line:=Kim}"Is this sort of parameter expansion a ksh speciality? I wonder why you prefer those awkward if/else constructs...?
2,334
Posted By Cochise
What is the environment?
What is the environment?
2,018
Posted By Cochise
Haven't understood the question/problem, but...
Haven't understood the question/problem, but maybe this helps:

echo "Who are you?"
read line
echo "Hi ${line:=Kim}"
2,521
Posted By Cochise
Excluding the record with the process ID of the...
Excluding the record with the process ID of the script should also do the trick:

...| grep -v $$ |...
2,090
Posted By Cochise
Doesn't this add a line to root's crontab when...
Doesn't this add a line to root's crontab when run as root?
I understand atanubanerji wants to set up a cron job for a different user (than root).
2,090
Posted By Cochise
Requirement was: "...will eventually set up cron...
Requirement was: "...will eventually set up cron job for a non privilege user."

As the crontab command has no option to write to another users crontab, it will need to be done like this:

echo...
2,270
Posted By Cochise
That is what I already had. Please re-read my...
That is what I already had. Please re-read my original post for what I am looking for.
2,270
Posted By Cochise
No mail in that case. Only in the rare case...
No mail in that case.
Only in the rare case that something is found, the addresse should be notified.
Showing results 1 to 25 of 27

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