Slackware :: Using A $variable With Find -name?
Jan 30, 2010
Here is my example code that doesn't work:
find $HOME -type d -name "$WHATEVER" -exec rm -rfv {} ';'
$HOME works ofcourse. it's $WHATEVER that -name doesn't honor. Has to be a variable. I really don't see a way around it because $WHATEVER could be any number of things depending on the circumstance. I've also tried other things:
find $HOME -type d -name '${WHATEVER}' -exec rm -rfv {} ';'
Using backticks will process $WHATEVER but it tries to execute it as a command instead of processing it as an argument to -name....
View 11 Replies
ADVERTISEMENT
Jul 25, 2010
I'm setting my CLASSPATH in /etc/profile.d/jre.sh. In a login shelleverything is fine. In an xterm window, the CLASSPATH consists of two of every intended entry.In jre.sh I am doing aCode:export CLASSPATH=$CLASSPATH:/many/paths/to/jarsSo I'm guessing this is getting run twice in the xterm case. Can someone explain what's going on here and what I should do to remedy this?
View 12 Replies
View Related
May 16, 2010
I'm using Slackware64-current and everything is fine except by the $TERM variable. When I try to run sbopkg, for example, i get this error message:
Code:
root pedro # sbopkg
tput: No value for $TERM and no -T specified
TERM environment variable not set.
tput: No value for $TERM and no -T specified
[Code]....
View 6 Replies
View Related
Jan 10, 2009
I have problems with setting my JAVA_HOME variable. I am using Slackware 12.0, bash shell. This is a question for the 'Linux Newbie' forum (not slackware-specific).
I have set JAVA_HOME in my /etc/profile, like this:
But when I login in with my user name and type env on the command line, I get for JAVA_HOME the following:
Also, in my /etc/profile I have put the path to my java in the PATH variable, like this:
And when I type env when I login, then the PATH variable contains correctly the path to the jdk (as I have put it into /etc/profile).
I expect that after I have set everything as I want in /etc/profile, and restart the computer then what I have set will be relevant and when I login and type env, I will get values to the variables equal to those I have set in /etc/profile. Why it does not happen?
I have particularly a problem with a Java application, which I want to run. When I type ant, I get:
error: JAVA_HOME is not defined correctly. We cannot execute /usr/lib/java/bin/java.
View 1 Replies
View Related
May 18, 2011
I have a file that contains 5 fields and anothen one with two I want to take the value from user and search file1 and if the value exists then write in file2 to the $2 to the line that $1=value
file 1
1:fsdfsd:g:33:fsdf
2:yytgdcf:a:3:sgd
3:tttt:g:67:yujhggfg
[code].....
View 2 Replies
View Related
Aug 27, 2010
What I have works, but wondering what is the 'right' way to replace the digits with the letters given in this loop? somehow use a case or multiple sed? i thought of a multiple sed or a case but couldn't get it to work
Code:
# ...
bcv=$(echo $line | awk -F" " '{ print $1 }' | sed 's/1/q/g;s/2/w/g;s/3/e/g') # and so on
Code:
while read line
do
bcv=$(echo $line | awk -F" " '{ print $1 }')
if [ $bcv == "" ]
[code].....
View 12 Replies
View Related
Jun 5, 2011
I'm mainly asking beforehand so I won't have to shoot myself in the head twenty minutes from now. I suppose I'll find/figure out one way or the other anyway . Can I just source the 32dev.sh and then run sbopkg -i if the source for the package I want to create isn't 64bit capable? I might need to change the $ARCH variable to x86_64 too, right?
View 1 Replies
View Related
Nov 11, 2010
I have a problem when i ried run this command (export HISTTIMEFORMAT="%F %T ") on slackware 13.0. the answer is the following (-bash: HISTTIMEFORMAT: readonly variable) I am running this command on the bash like root.
View 2 Replies
View Related
Feb 12, 2011
I am trying to patch linux kernel 2.6.24.7 with drivers for via chrome 9, by guidance of this article:[URL].. the problem appears when I run command: make xconfig I have following errors CHECK qt
[Code]...
View 2 Replies
View Related
Jul 27, 2010
I have been using tcsh for quite some time, both on a laptop running Ubuntu and a remote server running Slackware 11. No problem whatsoever. Now I am compiling and installing tcsh on a brand new Slackware 13 box and when I run tcsh I get this error:
Unknown colorls variable 'ca'
or
Unknown colorls variable 'hl'
I didn't have this problem in Slackware 11, why is it happening now?
So I tried the official Slackware package for tcsh. It works, but it's tcsh 6.15.00. Tcsh is at 6.17.00, which runs fine on my Slackware 11 box.
I investigated the problem on Google and all reports seem to refer to Fedora, some to Mandriva. Many of the threads, across several forums and sites, point to this LinuxQuestions thread:
[URL]
View 2 Replies
View Related
Jun 23, 2011
I am loading the file in Fortran. File looks something like this (shown below) I am interested in Velocity values and not Pressure values. Is there a way to code in Fortran which finds the staring LINE of Velocity values and ending LINE of values or I have to manually find the lines? IN this case it should return Starting line : 9 Ending line: 11
PHP Code:
[code]....
View 2 Replies
View Related
Oct 28, 2010
I'm not sure if I should post the whole script here (60 lines) but the script has a variable that occurs only three times, once when it's set and twice when it's referenced/read/expanded (not sure of the correct terminology)Anyway if I change the name of this variable from "maxdepth" to "findopts" the script throws the following error:
find: unknown predicate `-maxdepth 1'
But if I change the variable name to "maxIdepth" it still works? Here are the lines that this variable appears in:
maxidepth=('-maxdepth 1');
.
# other code, etc
[code]....
View 4 Replies
View Related
Mar 18, 2011
IN 3.5.10 I am able to display the full $PROMPT_COMMAND environment variable in the Konsole title bar. Kind of handy and I did not need to display that information in the $PROMPT variable.
In 4.5.5 I am having trouble figuring out how to make that work correctly. The title bar displays only the directory name rather than the full path and user name.
This is my $PROMPT_COMMAND:
history -a;echo -ne "33]0;${USER}@`uname -n`: ${PWD}07"
All I see in the title bar is:
dirname: bash
I should see:
username@hostname: full path to present working directory
View 5 Replies
View Related
Dec 16, 2010
When I do #./pdfedit.SlackBuil I get the information in the terminal:
[Code]...
Whether we want to checking PDFedit prepare-core-dev package ... yes Whether we want to checking build PDFedit gui ... yes configure: error: QTDIR environment variable must Be Set
View 3 Replies
View Related
Mar 22, 2011
after update to slackware current 4 days ago i cant get sound working in wine in starcraf 2 i mean i got sound in instalation but not in game and i get error when i wanna configure sound in winecfg
err:alsa:ALSA_CheckSetVolume Could not find '{PCM,Line} Playback Volume' element
err:alsa:ALSA_CheckSetVolume Could not find '{PCM,Line} Playback Volume' element
err:alsa:wine_snd_pcm_recover underrun occurred
err:alsa:wine_snd_pcm_recover underrun occurred
in game i dont got that error but sound dont work btw my sound card is asus xonar essence stx
View 2 Replies
View Related
Oct 19, 2009
Now i have 64 bit computer i installed Slackware 23 64 bit on it. i followed Alien Bob's multi lib how to and installed needed libraries one by one. everything is fine expect wine configure script can not find some libraries needed: libgsm, libmpg123, libopenal, libxcomposite.
I have already installed 32 bit compatibility packages and used /etc/profile.d/32bit.sh as recommended in Alien Bob's howto. configure -- does not really list anything for pointing for libraries.
View 14 Replies
View Related
Aug 21, 2009
I'm trying to read content of file to variable and use this variable in for loop. The problem is, when I have c++ comment style in file - /*. Spaces in line are also interpreted as separated lines.
For example:
Code:
Changing $files to "$files" eliminate these problems but causes that whole content of variable is treated as one string (one execution of loop).
View 6 Replies
View Related
Jan 7, 2011
I am assigning "find" operation output to a variable. I also need to have error info / stderr if nothing is found in the same variable itself.
e.g.
a=`find . -name "hello.txt" -type f`
I do not want any temp files to be in between infact, redirection.
View 5 Replies
View Related
Feb 17, 2011
how to assign a local variable value to a global variable....
View 2 Replies
View Related
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
Mar 9, 2011
I am trying to make a simple alias for find command that acceps a variable.
alias myfind="find $@ -type d -exec chmod 777 -fv {} ;"
this alias tells me that "find:paths must precede expression"
View 6 Replies
View Related
Jul 12, 2010
I am trying to write a Perl script that can open a file, find text that appears between two identifying strings (for now, "start" and "end"), then modify that text by enclosing it between "term_" and "_term" . Since the identified strings vary, the replacement string becomes "term_$1_term". From looking at other threads in this forum I've been able to get as far as spitting out the modified terms using the following code:
open FILE, "start2.txt" || die ("Could not open file <br> $!");
$text = <FILE>;
while ($text=~ s/start (.*?) end//) {
[code]....
The problem is how to get "term_$1_term" into the file in the same while loop, which I'm guessing would be some of variant of "$text=~ s/$1/$term/;" (which doesn't work as it stands).
View 6 Replies
View Related
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
Jun 10, 2009
I have a text file i that has a mailTo: NAME in it. In a bash script i need to extract NAME and put it in a $variable to use. How do i do this?
View 2 Replies
View Related
Apr 25, 2011
how I can search within a variable and assign the results to a new variable. I'll use the following as an example -
cars="Audi BMW Cadillac Chevy Dodge Ferrari Ford Mercedes"
list=`echo ${cars} | egrep -o '<A?+|<C+'`
with the echo command I get the following output assigned to list -
A
C
C
What I'd like to get for output is -
Audi
Cadillac
Chevy
how I could do this regardless of upper/lower case letters?
View 5 Replies
View Related
Apr 28, 2010
included shell script inside c program, and i wanted to assign the value of c variable to shell variable..Can any one please suggest me how to do it?
View 8 Replies
View Related
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
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
Mar 17, 2011
This loop is part of a bash script which takes multiple arguments.
Code:
for ((i=1;i<=$number;++i)) ; do
offset=$(($i+5))
[code]...
View 3 Replies
View Related
May 4, 2010
I am trying to buld some stuff that uses boost libraries... so i got this funny message about scons not being able to find this lib...
I am not sure what the correct "rules of engagement" are in this case, but I downloaded the Slackbuild from <current>, edited it for arch, and changed its --build-type from "minimal" to "complete"...
as soon as it finishes the build, I will upgradepkg my_new_boost_SBo.tgz
View 6 Replies
View Related