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 ]

[code]...

View 4 Replies


ADVERTISEMENT

Ubuntu :: Calling Script With Argument From C Program?

Feb 8, 2010

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:

my C program is:

#include<stdio.h>
#include<string.h>
#include<stdlib.h>

[code]....

I want to fill that blank with thevalue of argv[1] such that it will act as an argument for temp1.sh.

View 3 Replies View Related

Programming :: C++ Program Calling A Fortran Subroutine With A Function In The Argument?

Mar 9, 2011

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:

Code: //Main.cpp
#include <stdio.h>
#include <iostream>

[code]....

View 2 Replies View Related

Ubuntu :: Echo Command To Output First Argument

Nov 5, 2010

In a script, when I enter "echo $1" the first argument is outputted. When I enter:
a=1
echo "$$a"

The output is just "$1", not the first argument. If I enter:
a=1
b=$$a
echo $b

The output is still "$1" and not the first argument. How can I get echo to output the first argument without use "$1" directly?

View 4 Replies View Related

Ubuntu :: TTY Fonts - KDFONTOP: Invalid Argument ?

Jan 15, 2011

I was trying to change the console fonts. I remember that I did successfully change the console fonts back when I was using Jaunty with this:

Code:

View 8 Replies View Related

Ubuntu :: Error Failed: Invalid Argument

Mar 5, 2011

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

[code]...

View 6 Replies View Related

Debian Configuration :: Bad Argument '#' In Iptables

Jul 11, 2011

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

View 3 Replies View Related

General :: Setting Tcp Ip Argument While Booting Up?

Nov 23, 2010

how to set the tcp ip parameter while linux boots up in my board.

Currently i am giving it like : tcp ip=:::::eth0:dhcp

If i have my own static ip and its corresponding mac-id can i change it for my board when i boot up.

View 1 Replies View Related

Networking :: No Match For Argument - Ypserv ?

Mar 18, 2010

Heres what i have done:

Am i missing anything ? What is going wrong here?

View 1 Replies View Related

Programming :: Argument Relations In CGI Script

Feb 15, 2010

I have made fallowing script for CGI scripting learning purpose:

Code:
#!/bin/sh
echo "Content-type: text/html"
echo
CMD='echo "$QUERY_STRING" | sed -n 's/^.*cmd=([^&]*).*$/1/p' | sed "s/%20/ /g" '
echo "<html>"
echo "<head><title>Hello CGI</title></head>"
echo "<body>" .....
echo "<input type=radio name=cmd value=ifconfig checked> ifconfig <br>"
echo "<input type=radio name=cmd value=uname> uname -a <br>"

This script works fine, but actually I quite don't understand it's inner working about those radio buttons.

View 1 Replies View Related

Programming :: Insert $2 Argument Until The End To Variable?

May 17, 2011

how to insert $2 argument until the end to variable?For example:

>> cucu.csh user "long long message "
$1 = user
$2 = "long long message "

View 10 Replies View Related

Red Hat :: Error Inserting MD5 - Invalid Argument

Mar 24, 2011

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:

[root@ ~]# /sbin/modprobe -v md5
insmod /lib/modules/2.6.18-194.8.1.el5PAE/kernel/crypto/md5.ko
FATAL: Error inserting md5 (/lib/modules/2.6.18-194.8.1.el5PAE/kernel/crypto/md5.ko): Invalid argument

I ran dmesg and grepped for md5, but I didn't see anything in there.

View 1 Replies View Related

Ubuntu Servers :: Start Squid Automatically With -D Argument

Jan 10, 2011

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?

View 2 Replies View Related

Ubuntu Installation :: Cannot Mount /dev/loop0 :invalid Argument

Apr 8, 2011

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".

View 1 Replies View Related

General :: Pass Kernel Argument To Load Ubuntu?

Mar 11, 2010

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.

[code]...

View 8 Replies View Related

Fedora :: Argument Against Auto-mounting Of Other Partitions?

Apr 14, 2011

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.

View 6 Replies View Related

General :: Argument To Cp In Backticks Doesn't Work?

Nov 9, 2010

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.

View 2 Replies View Related

General :: Find Argument List Too Long?

May 12, 2011

I want to search in many many files for a string.

I used find /archive/* -print0 | xargs -0 grep 'robert' -sl

Is there a simple method to do it ?

View 2 Replies View Related

Programming :: Making A 1 Command Line Argument?

Jun 8, 2010

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.

View 2 Replies View Related

Programming :: Passing The Char * Vector Argument?

Jun 19, 2010

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.

Code:

#include<unistd.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

[code].....

View 2 Replies View Related

Networking :: Invalid Argument With Iwconfig Command

Jan 31, 2011

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.

View 1 Replies View Related

General :: Cannot Run ARPD Command - Invalid Argument

Aug 17, 2010

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].

View 2 Replies View Related

General :: Dmsetup Create Invalid Argument?

Nov 3, 2010

I am getting the following error message when running dmsetup command:

dbacb01:~ # echo 0 4096 linear /dev/loop1 0 | dmsetup create new
device-mapper ioctl cmd 9 failed: Invalid argument
Command failed
dbacb01:~ # uname -a
Linux dbacb01 2.6.5-7.282-smp #1 SMP Tue Aug 29 10:40:40 UTC 2006 i686 GNU/Linux

View 1 Replies View Related

General :: How To Pass Argument From Command Prompt?

Jan 5, 2011

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.

View 3 Replies View Related

General :: Read A Line In A File And Use It As Argument?

Mar 20, 2010

I want to do this

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

View 4 Replies View Related

General :: When Type Ifconfig - Invalid Argument

Jul 1, 2011

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.

View 12 Replies View Related

General :: Determine The Value Of The 'irq' Argument Before Calling Function?

Oct 27, 2010

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.

View 1 Replies View Related

General :: Sendto Failed -1 : Invalid Argument?

Sep 10, 2010

I'm not sure why the sndto() is failing.

STATUS send_request(const packet_t * pkt)
{
int fd = -1; /* socket filedescriptor */

[code].....

View 1 Replies View Related

General :: OSError: [Errno 22] Invalid Argument

Apr 19, 2011

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

View 2 Replies View Related

Server :: Option -m: Invalid Argument Near Character 14

Nov 26, 2010

Option -m: Invalid argument near character 14

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved