Programming :: [OSX] Shell Hangs / Get Started It?
Jan 14, 2010
When I start my shell it hangs (somehow, it's being put to sleep) and I always have to control-cancel the shell before using it. Anyone know of a way to figure out what gets started on a typical shell session?
View 1 Replies
ADVERTISEMENT
Jun 24, 2011
I am attempting to start ruby in interactive mode from the command line. However, when I type ruby at the command line, it simply hangs. I know that I have ruby installed. Any ideas as to how to resolve this problem.
View 2 Replies
View Related
Jun 5, 2011
I am trying to create a shell script similar to ls, but which only lists directories. I have the first half working (no argument version), but trying to make it accept an argument, I am failing. My logic is sound I think, but I'm missing something on the syntax.
Code:
if [ $# -eq 0 ] ; then
d=`pwd`
for i in * ; do
if test -d $d/$i ; then
echo "$i:"
code....
View 10 Replies
View Related
Jun 28, 2010
I'm going through the Beta version of "Agile Web Development with Rails - 4th Edition". But I'm having difficulty with initial configuration on my Gentoo box. I started like so, basically following the book:
Code:
$ rails testrails
$ cd testrails
$ script/generate controller Say hello goodbye
[Code]...
View 3 Replies
View Related
Dec 14, 2010
I recently installed KDE in my ubuntu 10.10. To access KDE, I want to use
startx /usr/bin/startkdeBut using it disables sound in KDE (Sound is working fine in GNOME). It doesn't sound for anything like login sound, totem, mplayer or any other playerBut when I press Alt+Ctrl+F1 to change to virtual console, the playback resumes from where it was in time and when coming back Alt+Ctrl+F7 and the time in totem (or any other player) doesn't move. While log out also it doesn't play logout sound and doesn't logout, so I have to press Ctrl+Alt+F1 so that logout sound play then it exits.When starting KDE by kdm or gdm, the sound works normally. But I don't want to login again using kdm or gdm and not to use root user to start kdm or gdm.I don't know what is the difference between when KDE is started by startx or by kdm/gdm where the same user login in kdm/gdm as that for startx
View 2 Replies
View Related
Jun 25, 2010
Is there some type of functional way to read things in the Python shell interpreter similar to less or more in the bash (and other) command line shells?
Example:
Code:
>>> import subprocess
>>> help(subprocess)
...
[pages of stuff to read]
...
I'm hoping so as I hate scrolling and love how less works with simple keystrokes for page-up/page-down/searching etc.
View 4 Replies
View Related
Jan 20, 2011
I created a ubuntu distro that originated from ubuntu server and have an xserver installed with openbox and am having problems getting autologin working. I had slim installed and everything seemed to be working except as soon as the monitor went into sleep mode and I moved the mouse to get it back it just came up to the shell again. With that problem I decided to remove slim and go with NODM and that worked perfectly for what I wanted but I was messing around with a few other configuration stuff and when I rebooted everything was fine until after the splash when it would normally boot into X it would show the shell for a about 10 seconds before it would boot to X.
View 2 Replies
View Related
Mar 22, 2011
This is probably hopelessly ambitious as I'm not a C or C++ programmer (I normally like to stick to scripting languages like BASH or Perl). Basically I'm looking on good advice to get me started with writing a Application Dock with the functionality of the OSX dock but without the overly flamboyant graphics that have characterised the Linux versions.At the moment the closest I've found to what I would like is bbdock. However it falls well short of the functionality of what I would like.
What bbdock does is read a file to create an icon for the openbox dock/fluxbox slit/wmaker whatever that launches an application when first clicked, shows an little arrow when the application is running, and brings the application to the fore when clicked once running.Here's a screenshot of it doing just that.The drawback to bbdock is that it doesn't really look for running applications, only those launched from bbdock. So for example it wont notice if I've launched an instance of pcmanfm from the openbox menu. And therefore it obviously also doesn't add icons for other applications that are running.
What I would like to be able to do is detect new running applications and add a bbdock icon for them. Also to detect if an application already with a shortcut has been run and update it's status to show it's open. Probably have an up and down arrow to move the icons up and down when there are too many to fit on the screen. None of the above needs fancy animation. The fade to gray effect used by bbdock is quite nice and could probably be augmented with a fade in and out to grey to represent another action, say fading to grey and back when launching and greyed when iconified.So, my question is what do I need to get started doing this? Am I best using the pretty outdated bbdock wmaker dockapp style? What functions and libraries am I likely to need to achieve the effects I want? Are there any examples of how to monitor running applications (well windows and figure out what constitutes a new application) that I could look at for inspiration. Is there anyone who's into C++ for linux who would be interested in helping me out to get this small project working?
View 8 Replies
View Related
Jan 26, 2010
My system: Ubuntu 2.6.31. Language C, compiler: gcc I am running dynamic timer as a kernel module and my issue is that the once the timer overflows, the program finishes. On the other hand i have forced to arm the timer again because of a while loop but the timer never is started again. i am targetting a periodic timer but it runs once and thats it.
[Code]...
View 1 Replies
View Related
Apr 2, 2011
i've written small tool in C which makes measurements on my router (OpenWrt White Russian).
It is working as a deamon. If the tool is started manually, everything works fine. If it is started per script on startup, the following system call doesn't work :
Code: sprintf(command,"/bin/cat /root/%s%s | /usr/bin/ssh -p2222 user(at)host -i /root/.ssh/id_rsa "/bin/cat >> result/%s%s"", apmac, source, apmac, dest);
rc = system (command); the returned rc in this case is 256.
first i thought it is a problems with the user rights for the tool, so i have added +s to it. but that didn't help. as i said, when the daemon is started by hand, the system call works fine.
View 1 Replies
View Related
Dec 15, 2009
I've created a simple script based menu. This menu will be accessed by only a certain users via ssh.When user logs in, the menu will automatically run. (configured at user's .bash_profile).How do I force the session to close when user hits Ctrl-C or Ctrl-Break ?In a nutshell, I don't want user to have access to shell.
View 11 Replies
View Related
Jan 21, 2011
I recently started shell programming and my task now is to do a menu display.Currently i am stuck whereby user will input both title and author and it will delete it.
Do i have to use sed command?
View 4 Replies
View Related
May 17, 2010
Is it possible to assist in the programming Shell Scripts
Job:
To send a message to the email,All orders written in Terminal or ssh
example : ls , pwd , cat , and other
View 1 Replies
View Related
Feb 4, 2011
I have a situation where I am in a non-interactive shell. I have tried from within my non-interative shell to spawn an interactive shell but my output still does not goto me. Isn't there a way I can somehow go into /proc or somwhere and make the output my /dev/tty1? Or some way else to remedy this?The situation arises because I drop from my restricted shell environment (a sort of CLI interface), into the actual Linux shell. I cannot change the code of the CLI environment I am just faced with being in the linux shell environment and its non-interactive. Its very annoying to have to put > /dev/tty1 after every command I type.
Not to mention it seems damn near impossible to get pagers like more and less to work properly when your in a non-interactive shell.
View 2 Replies
View Related
Jan 19, 2010
So I wrote a function in a class that logs the user in:
public function UserLogIn($username,$password){
if (!isset($username) || !isset($password)) {
header(Location: ../dev/index.php);
}
[Code]....
I've tested it on Linux (Ubuntu and Debian) and it works perfectly on Firefox 3 and Opera 9.5 on those two distributions. On Mac however, it hangs on both Firefox 3 and Safari. I have also tested it on Windows using Internet Explorer 7 and Firefox 3. why it hangs on Mac?
View 1 Replies
View Related
May 5, 2009
I have developed a proprietary multithreaded application using Qt library version 4.2.1 on RHEL 4 platform. The application communicates with different external interfaces using serial communication using well defined protocols. For each system I have a thread that handles data acquisition and processing, it sets an update flag which is read by the GUI thread to update GUI after specified number of seconds. The incoming data from external systems is processed and updated on GUI at certain intervals. Each system update rate on GUI is different. Generally it is 1 second. Their rate of sending data is different and is generally 1Hz, 5 Hz and 10 Hz. For systems with string data I have no issues. But some systems send raw data and I have to process every byte of the entire packet, for which I have to use for loops. Now my problem is if I keep the update rate of GUI for such systems less than a fixed number of seconds (which I have to calculate by hit and trial) the application hangs after sometime. I have tested this system exlusively by switching of all other systems and it hangs standalone.
This leads me to conclude that timing of GUI update is what is causing the application to hang. Also I read somewhere on the net that in multithreading application timers play an important role and slight variation in timing can lead to hung applications. As of now I have kept 5 seconds as the GUI update time and app runs fine. Can somebody suggest something else which might be the cause?Note that I have used mutexes, wait conditions and all necessary tools which are used in multithreading app. But it is only the timer on which I could pin down the issue.
View 6 Replies
View Related
Nov 29, 2010
I have a problem with programming serial port lines. my issue is that i must toggle and read single lines like rts and cts. but my program stops at the line when i open the port. here my sampe:
Code:
int port;
int i;
port = open("/dev/ttyS0", O_RDWR);
[Code].....
when I start the program it hangs on the open-function. I have tried ps with grep for ttyS0 but there is nothig found. Why hangs this function and gives me no error?
If I use ttyS1, it works. where is the problem and why I can't get an error?
target is an embedded system with busybox.
View 2 Replies
View Related
Oct 28, 2010
A thread-aware version of gdb receives a system notification when a thread starts in the app it is debugging. GTK+ has hidden threads associated with loading icons into menus. So trying to debug a GTK+ program, even one that is apparently single-threaded, can produce a deadlock between gdb, the app and XWindows. The app (actually GdkPixbufLoader) grabs the focus, the mouse and the keyboard and then starts a thread when a menu is opened. If gdb has trouble with threads, it leaves the app blocked but still holding the mouse, et. al. Then you can't talk to gdb or any other GUI interface. To make gdb happy, all GTK+ apps need to be linked with -pthread, if you have the source. If not, gdb cannot be used. In order to break the deadlock, you need a non-GUI shell. If your /etc/inittab starts agetty, mingetty, or the like, and you can get to it with <CRTL><ALT><F3...F6>, you can do a kill -KILL <pid> on the offending app, recover and then go back to XWindows with <CTRL><ALT> <F1/F2>. Otherwise it's reboot time.
View 3 Replies
View Related
May 16, 2014
The script below doesn't stop sickbeard, and just hangs. I really can't figure out why.
#!/bin/sh
### BEGIN INIT INFO
# Provides: SickBeard
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
[Code] ...
View 1 Replies
View Related
Jul 23, 2011
My program is creating 4 threads per transaction. Threads doing nothing but simply sleeping.
Now, when transaction ends, I want to wake up all the threads from sleeping. For this I am using pthread_kill() to wake up the threads using signal SIGUSR2.
Problem raises when I put more transactions(eg. 100 trans). My process gets hangup.
View 3 Replies
View Related
Jul 16, 2010
I'm writing a Bash script to take IPTC keywords from a text file and write them, via Exiv2, to several (first batch is 100) JPEG files in a single directory. The script has one while loop inside another while loop, both terminated, but I'm pretty sure that's not my problem. I think it's how I'm incrementing the "counter" variable, although it could also be the method of parsing the text lines from the file (using cut with delimiters that have worked fine in simpler scripts).
Here's the code as I've worked it up to this point.
Code:
And yes, "keywords" checks out in Crimson Editor, Emacs GUI and nano as an ASCII file with UNIX line endings. No issues on that score.
Feeding each line consecutively into a terminal (excepting the exiv2 command) works fine: each variable echoes with the part of the text line used as a variable value as it should, even when the b variable is incremented the quick&dirty way (up arrow three commands and hit enter).
Running the above script in eval mode (sh -x) stalls after setting the b variable to one and reading in the first line of text. I'd like to know why. I'd also like some advice on another reliable method of parsing the read-in lines.
View 14 Replies
View Related
Dec 10, 2008
I have a shell script that I would like to log to stdout and also to a file.....much like using tee. I would like to, instead of calling the script and piping to tee...i would like for the script to tee itself.
View 4 Replies
View Related
Jul 11, 2010
i got to build my own linux shell for my project
View 5 Replies
View Related
Jul 23, 2010
I have been searching most of today and am stuck on getting a variable into an awk portion of my bash script. I have this working:
Code:
#!/bin/sh
SRC=/var/log/mail.log
DEST=/var/www/output/myFile.txt
VAR=userName@myDomain.tld
[code]....
Can awk take a shell variable? Or do I have to do something completely different?
View 11 Replies
View Related
Apr 2, 2011
I need to push out a file to a bunch of linux and solaris boxes so I was hoping to use a script to automate the process with scp (or something else / better) - how can I batchmode scp so that it will do this? I should mention the servers do have keys set up so I do not have to authenticate manually or through something like an expect script...
View 4 Replies
View Related
Feb 16, 2010
I am having a shell script with following lines
ORIG_LOG_ARCHIVE_FORMAT=`grep log_archive_format $LOG_DIR/init$CLONE_DB.ora | cut -d"=" -f2`
SRC_LOG_ARCHIVE_FORMAT=`sqlplus -s "/ as sysdba" @$SCRIPTS_DIR/log_archive_format.sql`
echo $ORIG_LOG_ARCHIVE_FORMAT
[code]...
When I execute this script I am getting below output
'enin16_%t_%s_%r.arc'
enip131_%t_%s_%r.arc
sed: command garbled: s/'enin16_%t_%s_%r.arc'/
However when I do the exact above command on unix prompt (refer below) after setting values for all variables, it is not giving sed garbled error message. May I know what should I do to make it work inside the script as well?
$ cat init_refresh$CLONE_DB.ora | sed "s/$ORIG_LOG_ARCHIVE_FORMAT/$SRC_LOG_ARCHIVE_FORMAT/g" > $LOG_DIR/init_refresh1$CLONE_DB.ora
$
View 3 Replies
View Related
Mar 24, 2011
I'm trying to write a toy linux shell. For starters this is what I'm trying to do:
1. Start a new process with fork.
2. Execute a program in the new process with execl().
3. Redirect the output from the new process from STDOUT to another file descriptor, using dup2(2).
4. In the parent process, read the output from the child process and write it to the screen.
Creating a new process and executing a program in it is no problems, the problem is that I can't seem to capture the output from it in the parent process.
Code:
//digenv
//C++arl 2011-03-24
#include <stdio.h>
#include <sys/types.h>
[code]...
View 14 Replies
View Related
Sep 6, 2013
How to use shell command?
installs.sh:
Code: Select allapt-get install icedove-l10n-hu
apt-get install rar
apt-get install ...
...
y press key or other language is other key. hungarian key is: i
english after apt-get install in gnome-terminal: (y)es or (n)o
hungarian after apt-get install in gnome-terminal: (i)gen or (n)em
How to yes or no automatically in all languages? Not manual, not 'Y'/'I' or 'N'/'N' keydown.
I would like use this script my fresh installed Debian 7.1. I would like run this install.sh when Debian is installed for my all softwares when i would like use.
10 PC installing easy and faster my script.
If no script is slowly install for my 10 PC.
View 2 Replies
View Related
Apr 2, 2010
I would like to know if there is any way to detect a command if it going to be executed in the shell?
Eg:
Cmd: sudo apt-get clean I want a C program to be called before this cmd is executed.
View 8 Replies
View Related
May 10, 2010
Im having problems with this little thing in a C example Im doing. I want to show in the shell like this example:
Name Birthday
Tomas 13
Adrian 24
Nate 15
Im trying to use the printf function but the names doesnt have the same lenght. So I cant do it like this:
printf("Name Bithday
");
printf("%s %d
");
View 4 Replies
View Related