General :: Make A Variable Defined Outside A Script Identified Inside It?

Feb 8, 2011

i am runing the below script

foo..
if [ "$type" == "ok" ]
then string=ZZZZ:I=$number
elif [ "$type" == "NOK" ]

[code]....

the code inside sc2.sh needs to read the input from the variable (string) above. is there any way to make this variable recognized inside the sc2.sh

View 3 Replies


ADVERTISEMENT

General :: Count The Number Of Lines Inside A File And Put The Output Into A Variable?

Feb 1, 2011

i need to count the number of files and put the output into a variable. i used wc -l filename but i couldnt find an option to put the output to variable. example if the number o line is 5, i need the output of echo $x is 5.

View 3 Replies View Related

Programming :: Make A New Variable With The String From The Old Variable Btut Without Any Plus Sign?

Apr 7, 2010

my script has a variable which comes in the form +00.00 +0.00 -00.00 or -0.00 (the numbers can be any in that form) for any that have a + symbol I need to remove the +, but if it has a - symbol it needs to stay.

i need to make a new variable with the string from the old variable btut without any plus sign. I have tried a lot of different ways with no success, each thing I tried either left the + or removed the entire string. I think this should work but doesn't

foo=+12.40
bar=${foo#+}

View 4 Replies View Related

General :: Make A Cronjob Who Makes A Tag.gz Of Everything Inside A Directory In A Recursive Way?

Mar 23, 2011

I would like to make a cronjob who makes a tag.gz of everything inside a directory in a recursive way. BUT there is a HUGE directory full of jpg's. I don't want this one in the backup.Additional points if it can backup symbolic links.

View 2 Replies View Related

Programming :: Does Declaring Variable Inside A Function Give An Extra Overhead On An Application

May 14, 2011

Does declaring variable inside a function give an extra overhead on an application? Would it be better to declare the variable globally and just reuse it? Example

Code:

#include <blah>
char mybuffer[2048];
int main()

[code]....

The only difference is the declaration of my variable. Since myfunction() will be called many times will it add an additional overhead if it will create mybuffer[2048] over and over?

View 5 Replies View Related

General :: Make An Environmental Variable RPMS?

Apr 1, 2011

I'm trying to make an environmental variable RPMS that will resolve to a website. I know I have to make the changes in .bash_profile, but all the things I try don't seem to want to work.

I've tried:
PATH=$RPMS:ftp://rha-server/pub/os/rhel5/Server/
or simply just making the variable itself
$RPMS=ftp://rha-server/pub/os/rhel5/Server/

The second one made a variable just fine, but when I attempted to run this command:

rpm -ihv $RPMS/caching-nameserver*

View 5 Replies View Related

General :: Make A Variable = Filename Without The Extension?

Apr 23, 2011

I am trying to strip the .wav file extension from a file name so that I can pass the result to lame encoder. I started to write a BASH script that looks like this:

Code:

for f in /home/user/wavfiles*; do FILE=basename $f .wav; lame $FILE; done

It doesn't work very well though. For the life of me I can't seem to discover how to use basename in a suitable way for a script like this.

View 8 Replies View Related

Programming :: Access The "page" Variable Inside The Script To See What Args It's Been Given?

Apr 16, 2010

I have a PHP script which will show info from 5 lines in a MySQL database, with a "next" button to show the next 5 lines and so on. Initially it'll get called with a ?page=1 in the args in the URL, and then onward I want the "next" button to link to the same script , but with a ?page=2 in the args. First of all, how can I access the "page" variable inside the script to see what args it's been given? (sorry, extremely newbie question here )

And secondly, what will the code for the "next" button look like? If the script is called "seenames.php", I want this: print "A HREF="...cgi/seenames.php?page=$page+1">Next</A> , if you get my meaning. But what will the quoting for the above line be? I'm sure I've got it wrong.

View 2 Replies View Related

Debian Configuration :: Make Pulseaudio Work Inside Chroot

Apr 18, 2016

I have amd64 Debian Jessie and i386 Debian Jessie installed on my laptop. I wanted to start x86 app that is installed on my x86 OS from my amd64 OS using chroot.

My mounts inside chroot:
Code: Select all/dev/sda7 on / type ext4 (rw,relatime,data=ordered)
/dev/sda5 on /tmp type ext4 (rw,relatime,errors=remount-ro,data=ordered)
/dev/sda5 on /etc/resolv.conf type ext4 (rw,relatime,errors=remount-ro,data=ordered)
tmpfs on /dev/shm type tmpfs (rw,relatime)
proc on /proc type proc (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=000)
none on /sys/fs/cgroup type tmpfs (rw,relatime,size=4k,mode=755)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
/dev/sda5 on /var/lib/dbus/machine-id type ext4 (rw,relatime,errors=remount-ro,data=ordered)

sda5 is host OS and sda7 is guest OS

when I start any x86 app I can see "failed to create secure directory (/run/user/1000/pulse) permission denied" how to make pulseaudio to work inside chroot?

also what this command exackly does?

"pactl load-module module-simple-protocol-tcp rate=48000 format=s16le channels=2 source=auto_null.monitor record=true port=8000 listen=127.0.0.1"

View 2 Replies View Related

OpenSUSE :: How To Restore Data Inside Trash After Make It Empty

Apr 25, 2011

How can I restore the data inside the trash after make it empty ?I need to restore an important folder from the trash and I can't find it there.I am using openSUSE11.1 (KDE)

View 8 Replies View Related

General :: Assign Local Variable Values To Global Variable?

Feb 17, 2011

how to assign a local variable value to a global variable....

View 2 Replies View Related

General :: Create An Environment Variable With The PRINTER Variable?

Apr 16, 2011

I am supposed to create an environment variable with the PRINTER variable, which should resolve to the word sales. Would the command be like this?: env PRINTER - NAME=SALES (is this the command to create that variable with resolving the word sales to it?)

View 3 Replies View Related

OpenSUSE :: How I Can Make Variable Names Out Of String

Jul 13, 2011

I am bad with bash programming and I need some help how I can make variable names out of a string.I will need some help start doing that. And I think the first would be to get part of the filenames strings into variables.

View 7 Replies View Related

Ubuntu :: How To Make Variable And Read From Second Terminal

Apr 27, 2011

I have two terminals open and I want to save the current path in a variable and read it from the second terminal that I have open.

Then in the first terminal I type:
Code:
A=$(pwd)
And in the second I type:
Code:
echo $A
that doesn't work though.

I have tried also with
Code:
export A=$(pwd)
and
Code:
alias A=$(pwd)
but nothing seems to work. Is there a way to do this?

View 4 Replies View Related

Programming :: Make Bash Replace The Value Of A Variable?

Apr 18, 2009

I have a program I am writing where I have a for loop and I want to make it substitute the variable twice like:

for ((i=0;i<5;i++)) do
echo $"$i"
done

[code]...

View 3 Replies View Related

Programming :: Make Variable To Refer A File In A Folder?

Dec 16, 2008

How can i make a variable in a bash script, to refer each file in a folder,and to switch it to the next file,until the last file of the folder?

View 2 Replies View Related

Programming :: Make Radiolist Dialog Which Content So Many Options What Is The Value Of The Variable?

Dec 14, 2010

How can I make radiolist dialog which content so many options what is the value of the variable?Quote:

echo "How many options?"
read=VAR
dialog --title "sdf" --backtitle "sdff" --radiolist "ffdsfsd" 15 60 5 "1" "first" on "2" "second" off "3" "third" off "4" "fourth" off etc..

I must explode dialog in loop and add options? or something like that?

View 2 Replies View Related

General :: Use The Value Of One Variable To Generate A Name For Another Variable?

Jul 25, 2010

can i use the value of one variable to generate a name for another variable? for example i want to use the counter from a "do while" loop to name and define a variable each time the loop executes. for example

objectnames1=`ls -a`
objectnames2=`ls -a`
etc.

i don't have a script yet but each time through the loop i intend to cd to a particular directory and then define a variable containing a list of each object in that directory as values. for the rest of the script to work, each variable generated has to be unique, and i can't think of a good way to accomplish this.

if using a value from one variable to name another isn't possible, can anyone think of a more elegant solution? i know limited syntax but i'm willing to read up...

View 6 Replies View Related

General :: Sed Substitution Of Variable With A Variable?

Dec 27, 2010

I am trying to alter the character position of residue numbers above 999 in a pdb file.The following script is an attempt to:1) Get all unique pdb residue numbers (in column 5) using awk and assign it to a variable i.2) Loop through all the values in $i and if it is greater than 999, shift that number one character to the right using sed.However, the script only manages to alter the final residue numberCould anyone please advise how I can loop through all values in $i and shift it one character to the right?

#!/bin/bash
# Script to alter position of residue number in pdb file for resid above 999
i=$(awk '{print $5}' wt-test.pdb | uniq)

[code]...

View 6 Replies View Related

Ubuntu :: ISO Not Identified In Gmount Or K3B

Aug 12, 2010

Why Ubuntu would not be able to read an ISO that windows xp is fine with? I find that it's usually the other way around. This has occurred with 3 different ISO's. Gmount and K3b don't like em at all.

View 1 Replies View Related

Debian :: WiFi Card Isn't Identified By OS

May 28, 2015

I booted Debian in Live mode on a USB to try to see if the internet will work on my Linux machine before I actually install it (there is some tricky internet software where I live that I must overcome, but that will come in another thread).

Currently I have no WiFi whatsoever. When I go into the internet access menu I only get back the fact that there is a wired connection that's possible (theoretically, I should be able to also see networks to which I can connect to, but I don't). Also, it's impossible for me to actually get a wired connection going, unless I can somehow give it through my Windows laptop.

When I did some research, the people seem to say that I need to update the driver after enabling the use of non-free software; I can't do that since I have no connection in the first place.

The OS recognizes that the PCE exists (I am using asus pce-ac68), when I did "lspci" command it told me I have BCM4360 and BCM43225 chips.

I think I found the drivers here "[URL] ......" but I don't think my chip is listed there (there is no BCM4360 or BCM43225 on that list). What to do with those drivers, I mean how to compile them and install them on a Debian machine, and I'm not sure I can even install them on a live boot (but I want to make sure my internet works on the live boot before I actually install the OS).

View 12 Replies View Related

Ubuntu :: Btrfs Filesystem Identified As Ext4?

Jul 24, 2010

During the installation of Ubuntu 10.04 the partitioner was wrongfully configured to see a functioning btrfs partition as ext4 (without reformatting it). Thus the installation process got stuck at 5%.Installer was run again ignoring the btrfs partition.btrfs-tools was added to the new 10.04, but the btrfs partition is now recognized ast4 with lost+found folder on it.Tried to add the btrfs to etc/fstab as btrfs but t won't mount.Can the partition/filesystem type be changed so that this is actually recognized and mounted as btrfs, hoping my data is still on it somehow?

View 9 Replies View Related

Ubuntu :: How To Delete Un-Identified Characters File

Mar 1, 2011

I just found out that I did mistake.I transfer 1 file into the Ubuntu Linux,but that File has a strange character. Take a look at the picture screenshot taken.free image hostingExplanation: 1) The file name is unknown, take a look at the WinRAR Archive (left window)2) The file name recognized in Ubuntu without any name, thus it appeared as Empty (right window: putty program). And via Command Line Interface, it appeared as Question Marks.

View 5 Replies View Related

General :: Where Are The Keyboards Shortcuts Are Defined

Aug 18, 2010

when we do set -o ignoreof it will disable the working of ctrl+D confirm which file will effected with this command . also i want to assign that whenever i will press space bar my gnome-terminal will open how can it is possible . whre keyboard shotcuts working are placed any designation file ?

View 1 Replies View Related

General :: How Is The File Permission Is Defined

Jan 18, 2010

how is the file permission is defined?

for example when i use the command list -l testp01.txt i get the result of testp01.txt file permission -rw- r-- r-- root root etc however i wonder where are those information written?

is there any special file which contains all of these information?

View 7 Replies View Related

General :: No Root System Defined?

Jun 29, 2011

i installed an old hdd that i had laying around to my new desktop PC SO THAT I COULD USE IT SPECIFICALLY FOR UBUNTU. I FORMATTED IT THEN WENT TO RUN THE UBUNTU SET UP DISK.BUT I GOT THE MESSAGE "NO ROOT SYSTEM DEFINED" WHAT DO I NEED D

View 3 Replies View Related

General :: Version Glibc_2.0 Not Defined?

Jul 30, 2010

i m getting following error which executing a file : Code:version glibc_2.0 not defined in file libc.so.6 with link time referenceThe file is a binary file so cant be edited, its being called through a php file in which changes are possibl

View 14 Replies View Related

Debian Installation :: Keyboard Not Identified During Installing Squeeze

Feb 12, 2011

I am running lenny on my PC ( amd 64 / nvidia graphic ) without any problems. Since last week I tried to change to squeeze - without success. First step - update from lenny to squeeze accordingly to the upgrade description from the Debian homepage. After nearly 2 hours without any error message - Result : System dosen't boot after upgrade.

So I went back to lenny and tried the second step to get Squeeze working. I got the DVD "Debian-6.0.0-amd" and started the installation. After the second screen the keyboard is no longer identified and I cannot go on with the installation.

View 2 Replies View Related

Ubuntu :: Nautilus-clamscan Doc Items Identified As Viruses

Jul 14, 2010

I found today that ClamTK identifies items in /usr/share/doc/nautilus-clamscan/examples folder as possible viruses. The four files in question, "clam.exe, clam.cab, clam.exe.bz2, and clam.zip" are all part of the standard file list in packages.ubuntu.com. None are marked as executable, but are identified as binary files by less. Any ideas why these files are here or what they do, besides generate false warnings?

View 2 Replies View Related

General :: Error Message - GLIBC 2.0 Not Defined

Oct 1, 2010

Error message: GLIBC_2.0 not defined in file libc.so.6 with link time reference. What can I do?

View 1 Replies View Related







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