Ubuntu :: Write A Base Script Which Will Divide An Argument By 10 And Then Use That Argument In Another Program?
Feb 23, 2010
I'm trying to write a base script which will divide an argument by 10 and then use that argument in another program. Since my argument can be a floating point number, I used bc to accomplish this. Here's an example of a simplified version of what I have so far:
<code>NUM=$(echo "scale=25;$1/10" | bc)
#make sure the first argument was formatted correctly
if [ $? -ne 0 ]
I am trying to take argument from command line ic a Cprogram an give that argument as an argument to a script file which is called in that C program.Is it possible for example:
I have a new problem; i want to call a subroutine's fortran which have a function in the argument and the compilation ran properly, but when i execute the program this shows me an "Segmentation fault". This is my c++ program:
i downloaded baldurs gate II shadows of amn iso's, because i lost one of the CD's to the box, but anyways, I went to mount the third .ISO for installation, and BAM! my computer froze, so i waited five minutes, came back, and still frozen. shut it down for 20 minutes, pulled it back up, and it's got this error as follows; "Mount: mounting /dev/disk/by-uuid/65b0a6a-a366-435a-a086-58428cfe2bd1 on /root Failed: invalid argument
I follow this instructions but after iptables-restore < /etc/iptables.test.rules I see this error # iptables-restore < /etc/iptables.test.rules Bad argument `#' Error occurred at line: 3 Try `iptables-restore -h' or 'iptables-restore --help' for more information. The line 3 is the same as the link - # Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
I am running Red Hat with 2.6.18-194.8.1.el5PAE kernel version. I am trying to run encryptfs to encrypt a partition on my hard drive. One of the kernel modules necessary is the md5.ko. I noticed it wasn't loaded in when doing an lsmod. I tried running modprobe md5 and it fails to load:
I am on Ubuntu 10.04, running Squid 2.7.STABLE7 Squid refuses to start on my machine unless I give it the -D argument (disable initial DNS tests). I think this is because my machine is offline while I'm testing it, so no DNS server. how to set Upstart to start Squid with the -D argument?
I'm having troubles installing ubuntu on my "Acer one 522" netbook, I have made a pendrive with unetbootin and ubuntu 11.04 natty and upon booting into the usb i get the boot loader displayed properly, start to load ubuntu, then about halfway through i get some screen tearing with a really small shot of the boot loader screen in the top left hand corner followed by some command lines saying "cannot mount /dev/loop0 :invalid argument".
The ide has xp and I installed debian on the sata, the duel boot worked fine and still does. I then installed unbuntu on the sata along with debian but can't access unbuntu. when I tryed to install grub it error'd out so I bypassed that and finished the install. It told me I would need to pass a kernel argument to load ubuntu but I'm clueless about what that means.
I boot several Redhat based distributions, Fedora 15, Fedora 14, CentOS, Scientific Linux, Redhat and occasionally something non-Redhat based like Ubuntu and Debian. Out of habit and preference I frequently set up partitions to be auto mounted at boot through fstab. Somewhere in time something went seriously wrong with the CentOS install. There are a ton of permission denied errors while booting CentOS (text style boot) mostly regarding shared libraries. The system will boot to the desktop and everything looks OK but some things don't work. I can't update the system because I have no network connection. I obviously can't get to the Internet or get e-mail. I can open a VT but can't log in as regular user or root.
Permission denied in both instances. I didn't make any drastic changes to the CentOS system, just minor tweaks. The culprit in my opinion is a combination of the fact that one of the other Linux systems did an SELinux relabel while booting and the CentOS partition was already mounted. Since the CentOS partition was mounted it too was relabeled. I can't prove this. If there's a way to prove it then I just don't have the skills or knowledge to do so. It's basically a theory based on what I know I've done with the several installed distributions. This is not a rant nor is it a request for help. Just a comment. An assumption, hopefully a correct assumption. The CentOS install was working flawlessly until something happened and I think that something was the SELinux relabel.
I tried using a command likecp `ls ~/temp/*.xyz | head -1` ./But that does not work. If I echo the value of command inside back ticks and put it manually in cp command it works.
I need to write a script that will take 1 command line argument. The argument will be a username. The script will determine if the user exists on the system and will print an error if it does not. If the user does exist it will determine if the user is currently logged in, if the user is not logged in it will determine the last time the user logged in and display the file in the users home directory that was most recently modified.
I am trying to simulate a shell. So what I do is checking of having the parameters from standard input, suc as "/bin/ls -l /home/france/Documents", and then passing them to function execute, which at some point calls execvp(argv[0],argv)The problem is that I don't succeed in using these arguments, while if I call execvp(paramList[0],paramList) it works!!!! Where paramList is exactly what I would put on standard input, but defined statically.
I am trying to connect to a wireless network. I got a problem with network manager. So I try to connect manually
I found wireless network around by using "iwlist scan" command.
I want to connect to a network with ESSID "MCC(Mandalay)" and Key "mdymcctraining"
Here is my problem The output of "iwconfig" command is
Code:
What does it mean "invalid argument"? It means that my wireless pre-sharedkey is not correct? I am sure the key is valid. It is used by any others with window 7.
I've a problem when I try to run arpd program to support my honeyd software but when I try to execute it then it shows this error message ./arpd 10.0.0.0/8 arpd: intf_get: Invalid argument My arpd installation based on this tutorial [URL].
when I am running the script below,it performs on whatever logfile u type ,i.e, ./scriptname logfilename.But how do I convert it into a function and then call it from another script.I mean how do I prompt the user to enter a logname and then capture the name in the function and when calling this function from another script how do I pass the parameter.
read a files's specific line but return as argument only part of it ie
...
value # this is mass
value2 # this is force
so, how can I get / use the $value and $value2 as arguments for some other file and skip the rest of the line(s) ? of course, the values are different everytime, but the comment always the same, as well as the position of the lines in the file
When i type 'ifconfig eth0 192.168.25.1 255.255.255.0' the outcome is 'SIOCSIFADDR : invalid argument', but when i check the ip address using /sbin/ifconfig i see the ip address is updated to 192.168.25.1 and is up. When i restart the linux box,the /sbin/ifconfig is reset to 192.168.100.1 .what should i do so that the linux box /sbin/ifconfig should not change when am rebooting.
I read somewhere that you should not be reading config space to determine the irq value to pass as the first argument to request_irq(). What is the proper way to determine the value of the 'irq' argument before calling this function? Hope this is the correct forum. I don't see one for drivers.
iam having a problem while using the urlwatch utility in linux
/usr/bin/urlwatch --urls=/home/etika/Desktop/etikaa.txt file pathname is /home/etika/Desktop/etikaa.txt
when ownership is tomcat it doesnot run when ownership is etika(which is the user on the system through which iam running my script why the file which is passed to urlwatch is not accepted if that's file owner is tomcat6 it gives the following error
Traceback (most recent call last):
File "/usr/bin/urlwatch", line 221, in <module> for job in handler.parse_urls_txt(urls_txt): File "/usr/share/urlwatch/urlwatch/handler.py", line 128, in parse_urls_txt shelljob_errors.append('%s not owned by %s' % (urls_txt, os.getlogin())) OSError: [Errno 22] Invalid argument
but when the ownership of the file is changed to etika it run smoothly why urlwatch does not run when the file containing the urls is owned by tomcat with full 777 permission but run with etika (user on the system) through this iam running my shell script