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.
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
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.
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?
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:
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.
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.
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?
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)
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?)
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.
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...
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)
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.
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).
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?
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.
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 ?
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?
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
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
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.
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?