Programming :: Add Commands To A Limited Shell Program?
Apr 3, 2011
In below program I want to add (as part of the valid_cmds string) the pwd (print working directory), lo (logout), and cd (change directory) commands. However when I add those into original program ;
char *valid_cmds = " ls ps df pwd lo cd";
they are not working I have the cout message huh?
Original source code is below code...
View 3 Replies
ADVERTISEMENT
May 26, 2010
I need to process billions of small files using bash shell commands with limited memory size (256MB). If any of those files contain certain "keywords", the file will be removed. I tried with command:
find . -type f -exec grep -i -l -H "keyword" '{}' + | xargs rm -rf
where all files are located within the current directory. But the command above failed in "out of memory".
View 1 Replies
View Related
Aug 24, 2010
i need to run a command from a shell script that requires me to answer "Yes" to 2 questions that the command asks before it kicks off. how do i do this? i thought it was something like this.. from inside the parent script:
sh test.sh << "EOF
Yes
Yes
[code]...
View 3 Replies
View Related
Jan 5, 2011
I have a command which on the command line needs to look like this
rlam -if3 '!pvalue -H image1.jpg' > image2.jpg
Nevermind what rlam or pvalue do ... they are part of a program package I am using. The above command works on the command line, and also when written verbatim in a bash shell script.
My problem is: in the script I wish to replace image1.jpg with the content of a variable, e.g.
IM1=image1.jpg
How to I get the script to insert the value of $IM into the command when the pvalue part of it needs to be quoted?
View 1 Replies
View Related
May 11, 2010
I have a few questions regarding HTML, UNIX and Javascript. I've been tasked with creating a fairly simple webpage that takes a few inputs. Each input must correspond to an argument in a UNIX command running on a server.On a UNIX server we have a script (.ksh) that takes 3 arguments. The result of the script is a data file which is FTP'ed to an external server. Let's forget about the FTP portion for now. I would like to know where I should begin.What I know so far:
1) I will need HTML to create the webpage. Skill level is high
2) I will need Javascript to make my webpage more interactive. Skill level is high.
3) I will need to understand the UNIX environment. Skill level is high.
View 8 Replies
View Related
Jan 5, 2011
I am trying to create a RS232 C program that executes a series of commands down the line to a robot. Everything seems to work fine, except any sequential write to the serial port. At first I thought it was the UART's buffer being filled too fast, but even with a 50 uS delay it still throws the error.
Here is my code:
Code:
#include <termios.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/signal.h>
#include <sys/types.h>
[Code]...
View 1 Replies
View Related
Jul 14, 2011
Running a program with arguments using a shell script
View 1 Replies
View Related
Mar 26, 2010
I am currently working to develop a perl script for irssi that will capture data from irc channel hold it in memory as variable and send it to a shell. Does anyone know a good irssi irc scripting guide? something that will include $botname, $msg, $nick, $channel etc scripting explanation. Is it possible to send a run program command to shell thats located in my /home/user/myapp using ./myapp from irssi? i am using bash. I've only just started, so i dont have any code written yet,
View 2 Replies
View Related
Jul 1, 2011
In the MySQL database for one of my programming projects, I used a "YEAR(4)", because I wanted the column to contain four-digit year values. I discovered, though, that this type only allows values from 1901 to 2155, which is not workable as some year values are previous to the twentieth century. But I do not want a "DATE" type because the month and day are of no interest to me. What type should I convert to that would be the least radical change in data type, while giving more range?
View 1 Replies
View Related
May 22, 2011
The panel plugin from xfce4-mixer has a bug:s icon doesn't update as the volume is changed. This bug has already been reported.One curious thing about it is that, if you right click on the volume icon on the panel, go to 'Settings' (or 'Properties', I don't know, mine is in Portuguese) and then close the window that pops on the screen, the icon is updated.Is it possible to open and close the settings window automatically with a bash script? Like this, I could associate this script with the volume keys of my keyboard, so that the icon is updated as the the volume is changed.
View 2 Replies
View Related
Nov 26, 2009
what is the command for:
locking the screen
creating a new folder
log out
on the shell?
View 3 Replies
View Related
Sep 14, 2011
Programs like matlab/octave and I'm sure many other ones allow you to start typing a command, and then hit Up to recall the last command that starts with the typed characters. Common linux shell bash doesnot do this. Is there a different shell that does? I'm not asking how to find out the last command, I'm asking if there's a shell that's a little friendlier.
View 3 Replies
View Related
May 24, 2010
How can I run the following be run from a shell script, these are shell commands and mysql commands.
# mysql -uroot -ppassw
> use mysql;
> create database cacti;
> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cactipw';
# mysql -u root -p -b cacti < /usr/share/cacti/cacti.sql
View 2 Replies
View Related
Jun 23, 2011
I want to copy a file (home/remote_computer_user/Desktop/test1.txt) from my remote office computer (a permanent URL + open port) to my home computer (home/home_computer_user/Downloads/).
How can I do this with shell commands in Linux?
My current thoughts:
ssh <user>@<computer1address> -p <port> - gives me a shell on the remote computer
(I think I should use scp, but I dont how exactly how in my case)
What are the exact commands I should use?
View 1 Replies
View Related
Jun 3, 2011
Ok, so I have a few web apps that need to run shell commands. Heres a great example of one:
Code:
This is a PHP script getting my system volume. Herein lies the problem... www-data doesn't have permission to do this!
I changed my apache config to use MY account as the web user, and it does in fact work the way I want it to.
Obviously, I dont want to leave apache running as me, and want it to keep using www-data.... heres my question... how can I give permission for www-data to execute certain programs?
View 3 Replies
View Related
Aug 5, 2010
Ares there any shell commands to display all applications installed in my linux machine,?
View 7 Replies
View Related
Jan 5, 2011
I am trying to write a script that connects to a server and executes some commands on there. Something like this:
#!/bin/sh
telnet remote_machine
cd /home/some_directory
cat a_file_in_current_directory
Unfortunately after login/password I guess the script doesn't jump past the telnet command, until I exit. What do I need to do to make the script start executing commands in the remote shell?
View 1 Replies
View Related
Nov 7, 2010
i was trying to figure out a way to write my own linux commands.. in fact i wanted to write a shell script to simulate an already existed linux commands like 'cd','ls' and'adduser'i just dont know the language of scriptting and even doesnt know the steps to make a script
View 3 Replies
View Related
Jun 19, 2010
i want to know how can i change the owner of the mysql data base with shell commands.
View 3 Replies
View Related
Jun 26, 2010
php. I am developing a web-interface for an application that sometimes needs root privs. Editting /etc/sudoers is not an option since the web interface needs to be portable to other users when they install my application. Is there any workaround ?PHP Code:
php code:$command = "./script.sh /dev/$DISKNAME &";$shellOutput = shell_exec($command);
Code:
[code]...
View 2 Replies
View Related
Apr 24, 2011
I upgraded from Slackware 64 13.1 to Slackware 64 13.37 a week or so ago. I am now having a perceptible delay of a few seconds when launching commands from the command line, say for example: screen -R.
My laptop is an X200 with 3GB of RAM.
View 7 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
May 7, 2010
Is there any way to run commands of other programs from the terminal?opened a doc file from the terminal using>openoffice.org filename.docis there any way to executeSELECT ALL[ctrl + a] orCOPY [ctrl + c]from the terminal?
View 2 Replies
View Related
Apr 9, 2010
I want to execute Linux commands using a Java program. I came to know that we can use Runtime.getRuntime().exec("commands") to execute the commands through the program. I'm new to both Linux and Java.
View 2 Replies
View Related
Dec 15, 2010
Is there an easy way to prevent the logging of commands run into syslog as post-shell expansion?
I.e log a command of "ls *.log" as just that, rather than "ls a.log b.log c.log d.log" It makes rather a mess of the log files.
View 1 Replies
View Related
Jul 20, 2011
I am new to Minix. I'm so impressed by the speed of the system. It looks elegant, I like it. However, I have a question about the shell. In Linux, while using a shell, up and down arrow keys can be used to navigate through previously executed commands. On Minix with the sh shell, I can only get numbers printed out on the screen. I remember I chose a US-std keyboard when installing. Is there any way to use the arrow keys to navigate through previous commands on Minix?
View 1 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
Nov 14, 2010
I'm a noob in Ubuntu. I need the program which will help me to learn different ubuntu commands. I often forget them and after reinstall I don't want to search them in Google. Now I write them in the standard text editor and my code looks like this:
Restore MBR:
Delete GRUB (fixmbr)
Ubuntu terminal then:
sudo apt-get install ms-sys
sudo fdisk -l
[Code]...
View 2 Replies
View Related
Apr 26, 2010
I got to the prompt in the subject line. Then I typed grep /sounds/ and return.Then the program stopped responding to commands. I could type things, but nothing happened. Not even when I typed kill -9 and return.Why did the thing freeze up? I don't think there is folder /sounds/.
View 2 Replies
View Related
Jul 14, 2010
Note: I have made a thread similar to this before, but the title/contents were too botched to repair.I know that using C-r you can search for past bash commands containing a particular string, but how would you search for past bash commands matching a particular regular expressionIs there a keyboard shortcut for that or do you have to use a shell command?
View 4 Replies
View Related