and it gives following error Quote: ssh: myserver1..myserver2: name or service not known I basically want to pass arguments from myserver1 to myserver3 to the script.
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
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?
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.
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?
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.
I'm pretty sure this is super simple, but I've searched and searched and for the life of me I can't find any info on how to limit the columns that display in the interactive top program with arguments passed from the command line. I recall seeing something formatted like this ...
~/top -f (kdx)
Which would only show the %CPU, UID, program name fields/columns. I'd like to display the results in a really narrow terminal window on the right side of my desktop.
The script receives multiple files as parameters and it is supposed to count the number of lines in each of them and write that number in another file.
This is my script:
Code:
while [ -n "$1" ] do lines=`cat $1 | wc -l` echo "The number of lines in file $1 is $lines." >> lines.txt shift done
Is there any other way to do the same thing, without using shift?
Problem: I need a method to maintain the $i variable. In fact, actually, this variable get lost when executed. I think that an escape can preserve this variable and permit its execution inside the function, but I've no idea about.
I wrote a simple bash script to let me treat any set of programs like a deamon. For example if I configure the script a certain way I can start/stop/get the status of apache, mysql and php all from one command. I am having a bit of a problem though. I am passing commands as strings to a function and then depending on the arguments to the script it might run one of these commands or another. Some of these commands need to beun in the background though, such as deluge-web. When I send "deluge-web &" to the function and it execute it deluge-web does not start in the background. I can't figure out why this is. I have tried escaping the & with ''s and with a , but nothing seems to work. I know that this is some idiotic thing that I am overlooking, but I am a bit stumped. Here is the script configured to start/stop/get status of deluged and deluge-web.
I wanted to supply mplayer with the output of find command as arguments. The error returned showed spliced names of files whenever spaces occurred. I have subdirectories in my /home/my_user_name/Music/ directory, and in them multiple *.oga music files. The actual command that I issued was
mplayer started but then was looking for broken file names. I am thinking quoting has to do with it to preserve the filename as one string but different attempts were met with inroads:
Code: mplayer `find /home/my_user_name/Music/ -name "*.oga"` gave me the same result and Code: mplayer `"find /home/my_user_name/Music/ -name *.oga"`
I've written myself a linux program "program" that does something with a regular expression. I want to call the program in the bash shell and pass that regular expression as a command line argument to the program(there are also other command line arguments). A typical regular expression looks like "[abc]_[x|y]".Unfortunately the characters [, ], and | are special characters in bash. Thus, calling "program [abc]_[x|y] anotheragument" doesn't work. Is there a way to pass the expression by using some sort of escape characters or quotation marks etc.?
(Calling program "[abc]_[x|y] anotheragument" isn't working either, because it interprets the two arguments as one.)
I've written myself a linux program "program" that does something with a regular expression. I want to call the program in the bash shell and pass that regular expression as a command line argument to the program (there are also other command line arguments). A typical regular expression looks like "[abc]_[x|y]". Unfortunately the characters [, ], and | are special characters in bash. Thus, calling "program [abc]_[x|y] anotheragument" doesn't work. Is there a way to pass the expression by using some sort of escape characters or quotation marks etc.? (Calling program "[abc]_[x|y] anotheragument" isn't working either, because it interprets the two arguments as one.)
1. What file do i have to edit in order to include /usr/local/bin in the class path (ie. I put an executable in /usr/local/bin and when I try to execute it, it says the command cannot be found, etc.) EDIT: Solved, just didn't set PATH correctly. EDIT: New problem. When I try to execute a program in /usr/local/bin, it says "fopen: john.ini: File not found" Yet when i cd to /usr/local/bin, it doesn't say that. What would cause this?
2. Once I get my system setup the way i like it, how would i go about making it into a bootable CD/DVD?
3. How would I pass arguments from a shell script to a program?
i am installing Ubuntu version 9.10 in VMWare Work Station 7 but i can't get passed to 'Install Ubuntu'. I tried pressing enter but it still won't load.
I purchased this computer the other day at a garage sale. The computer starts up and the logo/ubuntu pops up with the scrolling load bar beneath but thats all the farther it goes. The monitor will go blank and then just restart the process all over again. Any help would be much appreciated
screen just opened up saying UBUNTU is running low in graphics mode
the following error was encountered. you may need to update your config to solve this. code...
I have been trying to install ubuntu for a few days. After I select install on the first screen using live it will switch over to the UBUNTU splash screen. I can hear the CD drive and that hard drive working for about 45 seconds to a minute then nothing. It will just sit there on the splash screen for as long as I let it. By let it i mean hours. I and installing it on a Toshiba laptop with 1.6 ghz centrino processor, 160 gb hard drive, and 2.5 gigs of ram.
This is one of the strangest problems I've run into while programming. Maybe there's just something wrong with my version of gcc or something.
The main problem comes at this point in the code:
Code: po = makePoFromScorbotXYZPR(X, Y, Z, P, R); h = makeHB2GFromPo(po); printf("%le", *h[1][0]); //##################################### Here it has the right value printf("%s", "
I'm trying to install F12 from the install DVD that I torrented but it's giving me a disk error when I try to install. The DVD loads but when I go to install, it crashes when loading initrd.img, saying:
isolinux: Disk error 10, AX = 4209, drive EF
Boot failed: press a key to retry...
The DVD iso does pass the SHA256 hash test, so that doesn't seem to be the problem. I'm using Roxio Easy Media Creator 9 to write the DVDs, which it seems to do without any problems. The only thing I haven't ruled out is Roxio - is this the problem or is there something I'm missing? If it is the problem, any suggestions for a better free Windows DVD burning program I could use?
I have a probably kind of unusual problem - when a USB stick is connected to the PC and data is copied from/to that stick, I need to know how much data has been copied. The data itself if not interesting, just how many bytes. I unfortunately don't have access to the program that does the copying, and most of the data doesn't end up on any drive (it just gets read and discarded), so I can't simply check the size of a target directory or something like that. I have had a look at usbmon, but that seems to produce way too much data - the normal case would be around 10 gig of data being read, and I can't have that blown up by a factor of 10 and lying around on the hard drive
I am writing a game in C with SDL. I can successfully display one image on the screen and animate it. However, I am having a lot of issues getting the background to display using the same method. I was asking for help on SDL related forums, but I determined that the issue is not SDL related, and it is actually a pointer issue. However, I can't find where I'm going wrong.