Ubuntu :: Bash Parameters With-c Switch ?

Mar 11, 2011

From the man page for bash...

Quote:

If the -c option is present, then commands are read from string. If there are arguments after the string, they are assigned to the positional parameters, starting with $0.

Code:

View 6 Replies


ADVERTISEMENT

Ubuntu :: Pass Parameters To Bash Through Shellscript?

Mar 21, 2010

How do I pass file names as parameters to the shell through a script? I have installed 'wipe' from the repos and it is a shell based app. so I made a shellscript and put it in my script folder.

the normal usage of wipe is 'wipe -q /path/to/file' so if I were to make a shell script, right click on the file in question, and run the script on it, how to I permit the shell to wipe that file only, in other words pass it as a parameter. I think on windows it was the use of %1, such as. 'wipe -q %1' for example, which was simple enough. how to I achieve this with bash?

View 2 Replies View Related

General :: Get N-variable Parameters In Bash

Mar 21, 2011

I've a script that it's invoked with n-variable parameters. Here's an examples:

Code:
./myprogram.sh inputdir FIELD1 FIELD2 ... FIELDN outputfile In the script I would like to get the FIELD names that were passed.

View 4 Replies View Related

Programming :: Bash Script Sed -r -i And -e Parameters?

May 3, 2011

I have a bash script where I am replacing a date with a variable

Code:
variable="date"
sed -r "s/([0-9][0-9])/([0-9][0-9])/([0-9][0-9][0-9][0-9])/$variable/g" /path/to/file.txt
I have googled but cant find any info on what the -r, or sometimes I have seen -i and -e, after the "sed" I googled "sed parameters"

r appears to output the replaced date, but not change the original file. Usually using -i will change an original file for me. Does anyone know what the -i, -e, -r are about? A link to an explanation would be good, as I have been unable to find one in my searches.

View 10 Replies View Related

Programming :: Passing Parameters From C Code To Bash Script

Apr 16, 2011

I get no print to stdout on screen from the C code.Does bash somehow block or mask it?I get print from bash. I get this error in the non-test bash script like: let "rdval = $rdstr"syntax error: operand expected (error token is " ")The let command prints rdval= but I presume this is due to the printf test statements getting in the way.I am getting no compile errors. Why does the C code not print the values specified?

View 2 Replies View Related

Programming :: Parsing Unflagged Parameters In Bash Script?

Apr 6, 2010

I've searched online and found many examples using getopts, but nothing that clearly explains it use, nor any examples of what I'm trying to do. I have a script named "process". It can take from 0 to 3 different options. I'd like to be able to handle these options regardless of the order that they are entered.

Syntax:
process [-v] [-d #] [-h|-?] [string]
-v = verbose mode on
-d # = how deep to do the process, expecting a number parameter
-h or -? = show command usage
string = only process lines containing the specified string

[Code]..

View 5 Replies View Related

General :: Check If Any Of The Parameters To A Bash Script Match A String?

Sep 8, 2010

I'm trying to write a script where I want to check if any of the parameters passed to a bash script match a string. The way I have it setup right now is if [ "$3" != "-disCopperBld" -a "$4" != "-disCopperBld" -a "$5" != "-disCopperBld" -a "$6" != "-disCopperBld"]but there might be a large number of parameters, so I was wondering if there is a better way to do this?EDIT:I tried this chunk of code out, and called the script with the option, -disableVenusBld, but it still prints out "Starting build". Am I doing something wrong?

while [ $# -ne 0 ]
do
arg="$1"

[code]....

View 3 Replies View Related

Ubuntu Multimedia :: Bash Script To Switch Filename Around

Jan 30, 2011

I was wondering if anyone knows how to do this in Bash:

I have quite a few music files which have names like this:

All my music is named "ARTIST - SONGNAME.EXTENTION"

I have been looking for a program or bash script that would fix this automatically, but I can't find anything that will do this. a script laying around?

Tried pyRenamer, and it does a lot of things, except this...

View 2 Replies View Related

Programming :: Switch User In A Bash Script?

Jul 28, 2011

I need to switch from one user to another in a script in a solaris machine. No one of those users is root. I see I can use su commandt I think I can't pass the password as a parameter . I'm using bash. Is there anyway that I can switch user in a bash script

View 7 Replies View Related

Hardware :: Replace Fibre Channel Switch In CentOS5.3 (cluster) For Regular Switch / Hub?

Jul 28, 2009

Can the fibre channel switch in the centOS5.3 cluster edition be switched for a regular router or hub?
If so how would one do this? If not why does the switch have to be fibre channel?

View 1 Replies View Related

General :: Switch Between Computers Using KVM Switch?

Mar 14, 2011

I am using a Fling KVM switch (by Belkin), to connect 2 computers to my monitor One computer is running XP and the other is running Linux. My wireless switching mechanism has just gone the way of the saints but Belkin has supplied a software solution for this occurrence. There is a small app called Fling (surprising) that allows me to switch from the XP machine to the Linux machine but nothing to switch back to the XP. What I need to know is there a similar app for the Linux computer. (NB I have tried Synergy but have no idea how to set it up - I've been told that synergy might work).

View 1 Replies View Related

Ubuntu :: Audio CD Extractor And VBR Parameters?

Mar 11, 2010

A couple of weeks ago I installed Karmic. In previous options in Audio CD Extractor I modified a string in the "edit preferences" to set the variable bit rate for MP3 ripping. Specically the option "VBR=4" (Lame New Algorthym) However, I now notice that the "VBR=" option is no longer there!

I've searched around and read some indications that using a newer realease of Lame this is no longer necessary. But its a bit unclear to me. Do I need to insert VBR=4 or not? and if I do anyway will it affect anything?

View 5 Replies View Related

Ubuntu :: How To Finetune Syndaemon Parameters

May 22, 2010

when one select System -> Preferences -> Mouse Preferences -> Touchpad -> Enable mouse clicks with touchpad, this results in sydaemon being started with the following parameters:

Code:
syndaemon -i 0.5 -k
while this is fine, for me the half second threshold seems to be too short, and I

[code]....

View 6 Replies View Related

Ubuntu Installation :: Kernel Parameters : How To Modify Them

Feb 4, 2010

Bottom line first: Is there a GUI or otherwise friendly tool to modify the kernel parameters? One that will give help on a highlighted parameters?

Now as to my reason for this question:

In preparing for an Informix installation, I may need to change some kernel parameters. I could follow the advice of G�rard BIGOT from a couple of years ago at this URL. However, messing with the kernel this way, by directly editing /etc/sysctl.conf, is a bit scary. I have already backed up the current one and started editing according the Informix machine notes. However, I have commented out my new settings. [:Chicken]

The scariest aspect of this is that the notes recommend settings to kernel parameters that I do not find in /proc/sys/kernel. for example, it recommends setting SHMMIN to 1 but when I can /proc/sys.kernel/shmmin, there is no such file. (I did find shmmax.) Similarly for the very logical shmseg (max number of shared memory segments) - not found. I am afraid to add these into sysctl.conf if the equivalent pseudo-files don't exist.

Additional question: Where [on-line] do I find all kernel parameters documented? This is so that I am more certain of what I am doing instead of relying on my memory. For example, I don't recall the names of the parameters that control Kernel-Asynchronous I/O (KAIO) events.

View 3 Replies View Related

Ubuntu :: Change The Background-image With Parameters?

May 31, 2010

I need to do a script to change the background image. I can do this with this command

PHP Code:

[Code]....

that work's fine but i need send some parameters to the background image

1)I need to set the style(mosaic, center, etc)

2)I need to set a color(because the image is smaller than the resolution)

I can't find how set this two parameters

View 2 Replies View Related

Ubuntu :: How To Edit Kernel Boot Parameters

Jun 18, 2010

Ubuntu 10.04 Gnome IBM Thinkpad 600e.I am trying to get sound going in my 600e which has the wrong chips in the sound card. I found some notes from 2008 that said in one of the steps to add the following to my kernel boot parameters: noapci nolapci notsc acpi=off pnpbios=off pci=noacpi

It said to hit the Esc key when I see the Grub Count on boot up to get into the kernel boot parameter's editor. However, I am not seeing any Grub Count and pressing the Esc key every second during boot up doesn't seem to get me there either. I have been searching for how to edit the boot parameters but no luck so far.

View 3 Replies View Related

Ubuntu :: Add A New Firefox Launcher To Top Panel With Parameters

Jan 25, 2011

I would like to add a new Firefox launcher to top panel with parameters but after a reboot both launchers end up same as the latest one.

View 3 Replies View Related

Ubuntu :: Cannot Save GRUB Kernel Parameters

Apr 27, 2011

We're using 10.10-server. We are trying to make grub boot changes permanent. I've already looked at thread [URL]. We updated /etc/default/grub, and update-grub propagates those changes into /boot/grub/grub.cfg, but not into menu.lst. It appears to use menu.lst as the source at boot, so our change doesn't show up as a linux parm.

View 3 Replies View Related

Ubuntu Installation :: Setting Boot Parameters For 10.10?

Apr 28, 2011

My keyboard doesn't work after the bootloader.

I've read that I need to add "i8042.nopnp=1 i8042.dumbkbd=1" to the boot options.

I have a 10.10 factory disk.

View 9 Replies View Related

Ubuntu :: Change Boot Parameters In Grub2?

Aug 10, 2011

I have a mental block whenever I'm confronted with anything to do with grub2. Changing things in menu.lst was SO much simpler....

I want to include the command 'acpi=off' - but where do I put it? Can I change the detail of an existing grub entry in this way, or do I have to create a complete custom menu entry in grub.d and include it in that?

View 2 Replies View Related

Ubuntu :: Pass Parameters To Grub At Boot Time?

May 2, 2010

Old Toshiba laptop model A30 -- tried various installs 8.04/9.04/9.10. They all hung trying to boot the install disks after the initial few screens. Finally, I got 9.10 to install, dual booting XP and 9.10 by choosing F6 from the initial menu, and putting an X beside:

ACPI=off
noapic
nolapc
edd=on
nodmaid

and then hitting escape.But, after the install, I couldn't boot 9.10 from grub as it hangs after about 30 seconds of trying. The live CD would not work without the above parameters being set as described above, but does work with them set! I need those same parameters passed to grub at 9.10 boot time, but I can't figure out how to do that. I've had many successful installs of Ubuntu across a number of desktops and laptops, but I never had to deal with the guts of grub before. It all just worked.

View 9 Replies View Related

Ubuntu :: BootUp Manager - Launch Services Using Parameters?

Aug 19, 2010

SQUID is launching on startup, I used BootUp Manager to do it. But I need to launch squid with -D parameter, don't know where to find and edit the script

View 3 Replies View Related

Ubuntu Servers :: How To Configure The Apache - Missing Parameters

Oct 15, 2010

My project for today has been setting up a web server. I was given a old computer with a Pentium 4 processor; 512mb of RAM, and a 42gig hard drive.I was reading over some guides and I came across this guide. It is very self explanatory; however I am having issues with my configuration files within Apache and my firewall (shorewall).I am focusing on web security. I don't even want to web edit until I know it is "lock-down" secure. In Apache are some supposed settings called Server Tokens and SeverSignature. I can't locate these files in my apache2.conf unfortunately.Here is what is posted to me in the config:

Code:

#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.

[code]....

Then press Control-O and Control-X. Your firewall is now configured to only accept HTTP and SSH traffic.I couldn't get that line of code to run. I've been all over the Ubuntu forums, google, Apache 2.2...

View 5 Replies View Related

Ubuntu :: Creating Link To A .java File With Parameters

Oct 24, 2010

I have a Java program (minecraft server) that needs to be run from the command line. The code is:

Code:
java -Xmx512M -Xms512M -jar minecraft_server.jar nogui

To make life easy (i've got the java file in a folder on the desktop) I want to have a shortcut (or similar) sitting on the desktop. I've tried

Code:
ln 'java -Xmx512M -Xms512M -jar minecraft_server.jar nogui' ./../minesraftserver

with single and double quotes but my unix command line skills are pretty basic and this is obviously incorrect.

View 2 Replies View Related

Ubuntu :: Positional Parameters Tutorial \ Don't Understand Its Concept?

Aug 14, 2010

need help with the Positional Parameters. I don't understand its concept.If you could give some example or and explanation

View 2 Replies View Related

General :: Parameters To Be Used With Chmod?

Jan 12, 2011

How to use CHMOD in linux? When I try to delete a file/folder, permission is denied. What exact params must I give for chmod here? This is what I need to do. Execute a command ./build.mips , but I get permission denied error.

kirti@sgf:/disk/go$./build.mips
-bash: ./build.mips: Permission denied

View 3 Replies View Related

Server :: Cannot Set Kernel Parameters / What To Do?

Feb 8, 2011

I have a strange problem with RHEL4.7, with kernel 2.6.9-78.

I cannot set any kernel parameters by editing sysctl.conf file and run sysctl -p, everytime the old value appears, while it was possible before.

I tried to edit files under /proc by using vi when trying to save it gives me: E667: Fsync failed!
While echo 1>/proc/sys/net/ipv4/ip_forward also cannot edit the file.

Also I mounted proc device on another mount point:

# mount -t proc proc /mnt

View 1 Replies View Related

Programming :: How To Run External Exe With Parameters

Mar 8, 2010

Specifically I'm trying to run xmacro from within a c program. If I were to run it from the terminal I would do it along the lines of Code: xmacroplay :0.0 < script_file.txt, but I want to run it from my c program. I'm fine with my c program running it from the terminal if that's possible and easier but I'm guessing there must be a better way.

View 3 Replies View Related

Ubuntu :: Change Queue Parameters Dynamically During The Simulation Under NS2 Simulator?

Sep 19, 2010

I want to change parameters of a RED queue during the simulation but it seems that some parameters can be modified only before starting the simulation, not dynamically, while the simulation is in progress. For example the following subroutines works before $ns run command but it do not change the behavior of the queue during the simulation( I want to change maxthresh_ and thresh_ after $ns

run command): Code: proc setREDParameters { redQueue MINth MAXth PER_MaxP Wq } {
$redQueue set thresh_ $MINth
$redQueue set maxthresh_ $MAXth

[code]....

View 1 Replies View Related

Debian :: Add Parameters To Module And TVtime?

Jan 25, 2011

Just installed squeeze from previous Lenny and am having problems. With Lenny, for the tv card, needed: the modudule saa7134 card=54 tuner=78, i.e. had to give it the card= tuner= stuff - it could not autodetect that bit. Squeeze appears the same:

Code:
[ 5.055340] saa7133[0]: subsystem: 17de:7253, board: UNKNOWN/GENERIC [card=0,autodetected]
So, question, how do I give it the module options? - the problem is 'modconf' will not unload the saa7134 module because it says it is in use, even though the TV is not being used. And # modprobe saa7134 card=54 tuner=78 does not appear to do anything - it does not say anything but nothing shows on dmesg. Here is how tvtime, a fairly fool proof tv player, behaves:

Code:
root@fido:/home/lugo# tvtime
Running tvtime 1.0.2.
Reading configuration from /etc/tvtime/tvtime.xml
Reading configuration from /root/.tvtime/tvtime.xml
mixer: Can't open device /dev/mixer, mixer volume and mute unavailable.

[Code]...

View 2 Replies View Related







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