Search Results

Search: Posts Made By: simonb
9,672
Posted By simonb
OK. Found out how to do it. ...
OK. Found out how to do it.


stty_state=`stty -g`
stty raw; stty -echo
keycode=`dd bs=1 count=1 2>/dev/null`
stty "$stty_state"

Where keycode contains the key code.
1,661
Posted By simonb
As long as script 2 has it's executable flag set...
As long as script 2 has it's executable flag set then simply placing the path of the script at the end of script 1 should call it.

#!/bin/sh
echo "This is script 1"
/usr/local/bin/script2
exit...
9,672
Posted By simonb
How to read arrow keys on really old bash?
I would like to get a script to respond to arrow key presses to scroll up and down a menu.

The platform is CDLinux which uses a prehistoric version of bash, version 1.14.7.

I would like to do...
15,249
Posted By simonb
Fixed!
OK, I wrote a script that does near-enough what I wanted to do...


#!/bin/bash
#Read time zones into array
i=1; for item in `cat timezones.txt`; do tz[$i]="$item"; let i=$i+1; done
i=1
echo...
15,249
Posted By simonb
Drop down menu in bash for timezone select
Is there any way to implement a drop down menu selection in bash?

This is on CDLinux which is a very minimal live CD and I am using it to install an image onto a hard drive. Part of that process...
3,462
Posted By simonb
Yes, that fixed it! I did a slight variation...
Yes, that fixed it!

I did a slight variation based on what I found in a Slackware rc.local script.



Not sure if it makes much difference (I have to burn another CD to find out), but I'm...
3,462
Posted By simonb
echoed prompt not appearing until after read command.
I have a script I am runing on a hacked CDLinux live CD called from /etc/rc.d/rc.local.

The part of th script in question goes like this.


When run from rc.local the prompt "Centre name :" and...
55,057
Posted By simonb
FYI CentOS is Redhat Enterprise re-compiled from...
FYI CentOS is Redhat Enterprise re-compiled from source RPMs with all the trademark stuff removed. It's good to play around with RHES for free before you need all the production-grade support etc.
...
55,057
Posted By simonb
Linux, CentOS4.1. Isn't netstat common to...
Linux, CentOS4.1.

Isn't netstat common to both Unix & Linux?
http://www.computerhope.com/unix/unetstat.htm
55,057
Posted By simonb
Easy way to get local IP address
I needed to get a machine's local IP address when not root (so no ifconfig).

Eventually, I arrived at this convoluted solution that grabs the unique local IP info from netstat...

netstat -n -t...
7,467
Posted By simonb
Wow, I never new it was so easy to get the PID...
Wow, I never new it was so easy to get the PID number from within a script!

Thanks :-)
5,080
Posted By simonb
Hi Richard, The tar command can be used to...
Hi Richard,

The tar command can be used to reproduce a directory tree with all the ownership and permissions preserved (though arbitary preserved ownership is only possible if you untar as root)....
7,467
Posted By simonb
OK I finally resolved this myself so I am posting...
OK I finally resolved this myself so I am posting the solution in case it helps anyone else out there.

It is possible to use the -i switch of xargs to pass the same file name to several commands...
7,467
Posted By simonb
find & sed -i work fine. Now need -i workaround for old OS.
I have a script that does a search and replace on a tree using find, xargs and sed that looks something like this.

find . -type f -print0 | xargs -0 sed -i 's/fromthis/tothis/g'

Now this works...
Showing results 1 to 14 of 14

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