Software :: Use Su With Arguments?
Jun 1, 2011
How to I use su to run a command, and pass arguments to that command, and not su?
ex: Code: su vmuser VBoxManage -q list runningvms I want -q to be specified to the VBoxManage command, not su. If I try any type of quotes it does not work either. Is there a way to do this?
View 3 Replies
ADVERTISEMENT
Jan 5, 2010
I am using an Acer Aspire Timeline 4810TZ with F12 installed. I have to enter the kernel argument intel_iommu=off each time I boot. This means pressing escape, going to the correct kernel, pressing A (to change kernel arguments), and then entering the command. I've seen some sources that suggest editing /boot/grub/grub.conf, but I've tried it and it doesn't seem to make a difference. I'm wondering if maybe there's another file that I have to edit, because I don't see the kernel arguments in grub.conf that I see when I press A in the grub menu.
View 4 Replies
View Related
Nov 16, 2010
I wanted to make an alias with arguments (like in cshell) which is in bash done by functions. The function must simply perform a command (nedit), append the arguments from the cli and make it run in the background (adding &).
So here is the function in a naive attempt:
Code:
when using the command
Code:
Code:
How can i use arguments and still start it in background? In cshell it was like:
View 8 Replies
View Related
Dec 16, 2010
I would like to get a log of all processes that are launched with the time that they were launched and the arguments they were launched with. Is this possible in Linux?
View 3 Replies
View Related
Mar 13, 2011
I have some source code of an application called gmapping.
I am pasting the source code documentation below:
SCANMATCHER:
How do I run this file. When I enter the filename parameter, and press enter, I get
COMMAND LINE: parameter aces not recognized no filename specified
GridFastSlam: Initialization Error!
(Did you specified an input file for reading?)
What is the right line to type in the terminal to sun this code?
View 1 Replies
View Related
Mar 26, 2011
I wrote a C program using Pthreads to compute the product of 2 matrices. Each element in the product matrix is computed in a separate thread. Eg: Thread (i,j) computes the element C[i][j] of the matrix C, where C=A*B. A is m*n, B is n*p, C is m*p. m,n,p are given as command-line arguments. A and B are initialized to random values from 1 to 10, while all elements of C are initialized to -1.But some threads do not get their arguments (i,j) correctly. So some elements C[i][j] still remain as -1, even after the program is over. My OS is Ubuntu 10.10 (Maverick Meerkat) 32-bit.I ran the program on another computer and it worked correctly. Is it due to a problem in the Pthreads library in my OS? Please help me. I have attached the source code.
View 3 Replies
View Related
Jul 3, 2011
I have a directory containing the following files.
Code:
1-res-opt-I189N-0001.pdb
1-res-opt-I189N-0002.pdb
1-res-opt-I189N-0003.pdb
1-res-opt-I189N-0004.pdb
[code].....
What I want is something like:
Code:
for i in *.pdb
do
python my_script.py 1-res-opt-I189N-00{1..10}.pdb 3-res-opt-I189N-00{1..10}.pdb
done
such that always the two files with corresponding index are submitted together to the Python script. How do I do that?
View 4 Replies
View Related
Jul 6, 2010
I've got a sticky little problem with a bash script. Please consider the following code:
Code:
#! /bin/bash
processArgs() {
echo "Count = $#"
while [[ $# -ne 0 ]]; do
echo $1
shift
done
}
processArgs $* If I call this script with Code: ./script first second third it'll print each of the argument on a new line - exactly what I would expect. However if I call it with
Code: ./script "Single Argument" "Second-Argument" it splits the first argument in two using the space as a delimitor. The problem appears to be the call to processArgs, where $* doesn't honour the quotes around the variables sent to the script.
View 4 Replies
View Related
Nov 18, 2009
I'm using gdb to debug my program. My program requires arguments (e.g., ./prog -dfile).But if I use gdb as in gdb ./prog -dfile, gdb wants to interpret the -d argument. How do I pass an argument to my program via gdb?
View 2 Replies
View Related
May 13, 2011
Suddenly, i have problems when i call a script when i use some arguments/variables
Here is my code:
Code:
This is my output:
Code:
View 3 Replies
View Related
Dec 13, 2010
I am calling script 2 from script 1. Is it possible for me to pass the output from script 2 to script 1 as the value of a variable. for eg.. path=`/XXX/XXX/script2.sh`
View 3 Replies
View Related
Jan 6, 2010
How can I get the total arguments in perl.To be more specific if I try to execute the command
Code:
perl -w myperl.pl ash ok kumar
I should be able to get all the command line arguments.
I know that @ARGV will store only the arguments passed but not the entire arguments.
View 14 Replies
View Related
Jun 9, 2011
I am using getopts to take parse optional arguments but i also pass in mandatory arguments first
[code]
#!/bin/bash
print_usage()
{
perror "$@"
}
arg1="$1"
arg2="$2"
shift 2
[Code]....
View 8 Replies
View Related
Apr 25, 2010
I ran installpkg on seamonkey 2.0.4, on Slackware 13.0, and it appeared to install OK. I can run /usr/bin/seamonkey -version and I get the 2.0.4 version number. However, when I run it without arguments, no windows get opened, and there are no errors that I have located (eg messages, syslog). This is probably something real obvious, but I'm drawing a blank. BTW, firefox runs OK.
View 12 Replies
View Related
Nov 5, 2010
I'm not really new to debian. Just never encountered this before. I'm not even sure how to describe that. The first time I realized something was wrong when I tried to create a file with dd:
root@strych ~# dd if=/dev/zero of=1GFile -bs=10M count=100
dd: bad operand `-bs=10M'
I mean what, I've done that many times before! Then I noticed that some commands started to behave this way:
root@strych ~# ls --help
--help: No such file or directory
On the other hand...
root@strych ~# fish --help
fish - the friendly interactive shell
or
root@strych ~# apt-get --help
apt 0.8.6 dla i386 skompilowany Oct 4 2010 11:55:22
Usage: apt-get [options] command
apt-get [options] install
So what the hell is wrong with my shell? This is persistent with any type of access: both ssh and local (physical), it's the same when I use sh, fish, bash or whatever. It also doesn't matter which user I'm logged in with. I haven't changed .profiles or anything concerning terminal really, besides installing fish but even that was long before I realised this problem. Actually, I can't think of anything that I've done that could do this. What am I missing? The system is debian testing with kernel 2.6.32-5-686.
View 9 Replies
View Related
Mar 29, 2011
How do I set ls so that when I type ls it actually runs ls -l. This Sounds minor but I'm trying to save keystrokes wherever I can. This is on Ubuntu 10.10.
View 4 Replies
View Related
Mar 24, 2010
I have a script gdrGltoDataRefresh.sh .while try to run the script it's giving:
And in log file it's giving:
View 5 Replies
View Related
Oct 11, 2010
i was wondering if someone could help me figure out a script for global variables i'm trying to set for a group of command line arguments:
basically i'm trying to set: if $# = 3 then i want to search for each all string $1 $2 $3
if $# = 4
then i want to search for each all string $1 $2 $3 $4
View 2 Replies
View Related
Mar 5, 2010
I know that $1 ... $n will set the argument to the values but what happened if I have many options in one scripts lets suppose.
I can run:
myscript -1stargument -2ndargument -3rdargument
or myscript -1stargument
or myscript -1stargument -3rdargument
In my scripts I have
if [ $1 = "-1stargument" -o $2 = "-2ndargument"] #for every instruction I need
fi
but is there any way to do:
if [ (any arguments or commands) = "(mydesired option ] ; then
(do this...)
fi
View 6 Replies
View Related
Aug 17, 2010
I've been reading about getopt and getopts but it doesn't seem like it's possible to parse arguments like --foo or even -foo. I've started my own script trying to achieve this, but I'm still wondering if I'm losing performance and if there is a better way to do this task.
Also I'm using the [[ =~ ]] regex syntax which seems to be available only in newer bash versions, should it be a big issue? My bash version: GNU bash, version 4.1.7(2)-release (x86_64-unknown-linux-gnu)
[Code]...
View 6 Replies
View Related
Jul 24, 2011
Whats wrong with this:
Code:
#include <stdio.h>
int main(int argc, char *argv[])
{
if(argv[4] == "-verbose")
{
printf("Verbose is on");
[Code]...
View 2 Replies
View Related
Oct 9, 2010
I'm trying to compile the hidtouch driver, but hit a snag. The error I get is
[code]....
Context: this is the driver for the touchscreen attached to an LTSP client. The server uses the AMD64 arch, the client uses the 1386 arch, both Debian. The client does start, but lacking a pointer device the pointer is useless. The build takes place on the server, in the i386 chroot of the LTSP setup. Basically, I'm stuck now...
View 5 Replies
View Related
Jul 14, 2011
I need to call functions that match an input string (if input str = "func1", call func1), so I have this:
Code:
#include <stdio.h>
#include <string.h>
void function_a(void) { printf("Function A
"); }
[Code].....
In the above example, the functions take no input arguments. Can they take a different number of arguments, for example, function_a(int), function_c(int, int), function_e(int, char, int)? How can I do that?
View 3 Replies
View Related
Mar 1, 2010
I need to pass a large number of arguments to a function which takes variable number of arguments, such as gtk_list_store_new. But it doesn't look nice if i write something like gtk_list_store_new(NUM,TYPE_A,TYPE_B,TYPE_C,...,TYPE_OMEGA); because of large number of arguments. And, it will be a trouble to change number of columns because of need to manually change arguments to large number of such functions. So, how can i pass all the arguments to a function using a loop? Something like
Code:
for(i=0;i<NUM;i++)
{
push_arg(args[i]);
}
call_function(func);
?
Of course, i could just use asm code for this, but is there a portable way of doing so?
P.S. i mean C language.
View 2 Replies
View Related
Mar 5, 2010
My hosting server does not allow exec() or system() calls, for security reasons. I can call a cgi process in two ways. From a .shtml page, i can issue a directive like code...
View 11 Replies
View Related
Feb 1, 2010
I want to know how to get eg. the contents of a form on a webpage which has been passed to a server side PHP script, inside for example an array which I can read. I've been reading a ebook on PHP which as far as I can see doesn't cover this inside it.
View 1 Replies
View Related
Feb 7, 2010
what I am trying to do is to pass an argument to the standard input stream of a child process. I mean I create two programs .. first one invokes the other. second one contains something like
Code:
scanf("%d", &n);
now I want my first program to be able to pass a value to the second one so that it gets stored in n.
View 7 Replies
View Related
Dec 17, 2009
I am calling another executable in my application (C programing) using "system" command
which is user interactive program. now i want to pass those args in system command only.
system(" executable ");
Executable will expect 1,2 or 3.
1 is to continue
2 for do changes in settings
3 exit from application
how to pass these in to system command
View 1 Replies
View Related
Mar 22, 2009
I want to write a little time-saving alias for my .cshrc file that will move files and then cd to the directory I've moved them to. What I can't quite figure out is the syntax to say 'move all the arguments except the last one.' Here is what I have:
alias follow 'mv !:1-$-1 !:$; cd !:$'
This actually seems to work, but it also gives me an irritating error:
mv: cannot stat `destinationdirectory/-1': No such file or directory
Similarly, I tried:
alias follow 'mv !:*$#argv-1 !:$; cd !:$'
Again the move and cd are successful, but again there is an error:
mv: cannot stat `destinationdirectory/0-1': No such file or directory
View 1 Replies
View Related
Feb 28, 2010
It seems incrontab wont see spaces properly at all. I setup a script to echo the arguments passed to it by incrontab to a file, and no matter what I put around the arguments on the incrontab file it will count a space as the next argument.
I have written a script to automatically retrieve imdb artwork for a given filename. Here is the script:
Code:
You can ignore all the commented "echo" commands that was just me testing. Anyway, the script work fine, however I am trying to use incrontab to monitor a folder, when a new (video) file is moved into the folder, it should execute the script and retrieve the artwork. My problem is, when incrontab passes the $# argument to my script, the script wont work because the spaces aren't escaped.
Here is some more detail:
Incrontab
Code:
Code:
The problem is, the script GetArtwork, doesn't see "Bangcock Dangerous" it just sees "Bangcock"
I have tried putting quotes around the $# in the incrontab - this just makes the script see "Bangcock (notice the single quote character)
View 2 Replies
View Related