Forum: Shell Scripting Jul 7th, 2009 |
| Replies: 5 Views: 735 No, this script cannot be converted to an ash script. |
Forum: Shell Scripting Jul 6th, 2009 |
| Replies: 2 Views: 623 Your problem is here
sed -n "s/<idle>600<\/idle>/<idle>900<\/idle>/p" $f >> $f
You need to use either the -i option to GNU sed to permit in place editing or save the output to a temporary file... |
Forum: Shell Scripting May 30th, 2009 |
| Replies: 3 Views: 1,025 I suggest you start top in batch mode and with the number of iterations set to 1. This way you take a a quick snapshot of things and save it to a file. |
Forum: Shell Scripting May 20th, 2009 |
| Replies: 5 Views: 894 One way is to use an ed script. For example
$ cat ed.script
/ssl-qop-mgmt-default/a
default = DES-168
default = RC2-128
default = RC4-128
#default = ALL
.
+1d |
Forum: Shell Scripting May 20th, 2009 |
| Replies: 1 Views: 665 awk -F'[ :]' ' NF == 8 {print $4}' input.txt |
Forum: Shell Scripting Apr 22nd, 2009 |
| Replies: 3 Views: 1,562 What is the output from running the following 2 commands: df, mount |
Forum: Shell Scripting Apr 7th, 2009 |
| Replies: 1 Views: 504 Yes, shell scripting can be used on the Microsoft Windows command line. All of the modern shells have been ported to this evironment including bash and ksh93. Speed of execution depends on your... |
Forum: Shell Scripting Mar 20th, 2009 |
| Replies: 2 Views: 894 You do not need to use the pipe. Instead use redirection
echo -e "10\n20\n100\n200" > file.txt
number=0
while read line
do
if test $line -gt 100
then
number=$line |
Forum: Shell Scripting Mar 18th, 2009 |
| Replies: 4 Views: 1,229 You need to format your output using printf instead of using print. |
Forum: Shell Scripting Mar 15th, 2009 |
| Replies: 2 Views: 1,200 $ awk '{ if ($3 > 40) four="yes"; else four="no"; print $0, four }' file
1 abc 67 yes
2 def 40 no
3 uty 57 yes
$ |
Forum: Shell Scripting Dec 17th, 2008 |
| Replies: 10 Views: 2,062 Don't forget to initialize the sequence of random numbers by assigning a numeric value to RANDOM before you start retrieving them. Otherwise you may get the same set of numbers each time. See... |