problems with shell

problems with shell

Post by Josh » Wed, 14 Aug 2002 02:05:11



i am trying to add output from acpi to my rprompt in tcsh:

if head -n1 /proc/acpi/battery/1/status | awk '{print $2}' = 'yes';
then
echo "Turning off filesystem quotas."
fi

the echo was just a tetst...basicly i want it to report if field 7
contains until, then print fields $6, $7 and $8, but if field $7
contains chargded, only printt $6 and $7.  however i go about
implementing this, i get errors, any ideas?

also, in tcsh..., using
tar c /bin/login /bin/qutlogon /bin/ls 2> /dev/null| md5sum >
/tmp/filesck i get ambiguos redirect...any ideas?

as a side question, if a switch is a layer 2 device, why does it have
an ip address?

thanks guys.

 
 
 

problems with shell

Post by roland rodrigu » Wed, 14 Aug 2002 05:32:02



> i am trying to add output from acpi to my rprompt in tcsh:

> if head -n1 /proc/acpi/battery/1/status | awk '{print $2}' = 'yes';
> then
> echo "Turning off filesystem quotas."
> fi

> the echo was just a tetst...basicly i want it to report if field 7
> contains until, then print fields $6, $7 and $8, but if field $7
> contains chargded, only printt $6 and $7.  however i go about
> implementing this, i get errors, any ideas?

Not clear what you want; the 'head' can be avoided:

awk '{printf(($7~/charged/)?"%s %s\n":"%s %s %s\n",$6,$7,$8);exit}'

Quote:

> also, in tcsh..., using
> tar c /bin/login /bin/qutlogon /bin/ls 2> /dev/null| md5sum >
> /tmp/filesck i get ambiguos redirect...any ideas?

I think in tcsh you cannot yet have separate redirections for sdtout
and stderr.

Quote:

> as a side question, if a switch is a layer 2 device, why does it have
> an ip address?

A switch is often configurable with SNMP, thus it needs to be accessed
as a node in the network.

Quote:> thanks guys.

--
roland

 
 
 

1. Help Root SHELL Problem NO SHELL

This is a multi-part message in MIME format.
--------------B4AB529002C8AB6370D2C480
Content-Type: text/plain; charset=us-ascii
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Transfer-Encoding: 7bit

I edited the /etc/passwd file for the root user to change the shell
entry from /sbin/sh to /sbin/ksh and saved the file.
Only to realize that ksh is in the /bin directory. I cannot login or su
to the root id because it can't find the ksh. Is there any way to get
back into the system for root. the error message is NO SHELL. Not being
that familiar with Solaris 2.5.1 , is there any way to bring up some
sort of mini kernel.
Any help appreciated.

--------------B4AB529002C8AB6370D2C480
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Charles  Allen
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Charles  Allen
n:              Allen;Charles
org:            SS/OS Common Services
adr:            3865 Airways Blvd;;MEM/TN/8521 Module F 2nd Floor;Memphis ;TN;38116;USA

title:          Systems Advisor
tel;work:       (901) 397-4211
x-mozilla-cpt:  ;0
x-mozilla-html: TRUE
end:            vcard

--------------B4AB529002C8AB6370D2C480--

2. localhost: Network is unreachable???

3. Date setting problem on shell script?

4. Hard Disk Size Problems...

5. Serial Problems with Shell / Cron

6. AMD K6 support

7. Newbie problem with shell scripts in Linux.

8. Error and warnings linux-2.4.19-pre9

9. Problem with shell

10. .forward file having problems executing shell script?

11. cleartool problem in shell script

12. problem in shell

13. GNOME problem gazillion shells