General :: Saving A Content Of Files(contain Location To A Directories) Into Variable?

Nov 22, 2010

#the file temp contain a path to a directory int the first line
a= `head -1 temp`
bash: /home/ram/linuxTraining/scripting/testDir/test1Dir/test2Dir: is a directory

View 4 Replies


ADVERTISEMENT

General :: Move Some Of The Files From Multiple Directories To One Location?

Jun 17, 2010

I'd like to move a selection of files from all the sub-directories within an overall directory to a single destination. I don't want any of the directory structure, just the files themselves. This is what I tried so far:

mv /dir1/*/igs*.sp3.Z /dir2

There are other .sp3.Z files in the * directories within /dir1 but I just need the ones that start with igs..

View 4 Replies View Related

Programming :: Bash - Read Content Of File To Variable And Use This Variable In For Loop ?

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

Ubuntu :: Restore Backup Server - Where Is The Location Backup Snapshots Or Files Are Saving

May 10, 2011

I install and tested Restore EE Backup server on a test PC with basic configuration and its working fine.

[URL]

The issue i have is where is the location these backup snapshots or files are saving? I want to add a separate Storage to save the backup?

View 1 Replies View Related

General :: Ubuntu Etc/profile: Environmental Variable Doesn't Display Content?

Jul 28, 2011

i am trying to declare an environmental variable in the /etc/profile' (as per the tutorial i'm following) but when i declare it and do an echo i get nothing.Here's what i've done so far..nside /etc/profile:

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
if [ -d /etc/profile.d ]; then

[code]...

View 12 Replies View Related

General :: Create A Backup Directory And 3 Directories Within That And Some Files Within The 3 Directories And Then Back Them Up Ot Restore Them?

Dec 19, 2009

i am in need of linux help. iam at college and i need this back/restore script to pass this final part of an assessment. i require a backup script that will not only backup but also restore files to the relevent directories. e.g. users are instructed to store all wordprocessor files in a directory named wp. so i am needing to create a backup directory and 3 directories within that and some files within the 3 directories and then back them up ot restore them. l know i should/have to do this myself by been trying to get/understand info for the last few days and came up with zero.

View 14 Replies View Related

General :: Copy A Set Of Sub Folders From Their Multiple Parent Directories To A New Location

Nov 5, 2010

I am attempting to copy a set of sub folders from their multiple parent directories to a new location.

For example, I have three folders to copy:

I would like them to be copied to:

In actuality there are many folders besides folder1, folder2, folder3, and no numerical order exists. So, the folder named 'photos' would be copied to its parent folder's name in a new location. I would need this to occur for all folders in the '/home/user' directory.

View 6 Replies View Related

General :: How To Store Files / Directories In Different Different Directories?

Mar 23, 2011

I am writing a script, in that my requirement is, if all the fill types stored in one directory from that we need to separate different different directories based on the file types.

for example in a directory(anish). 5 different types files
1- directory
2- .txt files
2- .sh files

like that and my requirement is the (1- directory is moved to one new directory(dir) which we are given in the script)and (2 .txt files are moved to another new directory(test) which we are given in the script)and ( 2 .sh files are moved to another new directory(bash) which we are given in the scrip)finally the directory anish should be empty..using bash script.how it is possible !!

View 7 Replies View Related

Programming :: Saving A Certain Variable And Using It In All The Classes?

Feb 4, 2010

facing a problem in declaring variables. i have a few classes like the one below...

Code:
#ifndef _FINANCE_H
#define_FINANCE_H

[code]....

View 1 Replies View Related

Ubuntu Servers :: Saving To /var/www Directories From Aptana

Mar 30, 2010

Designing a website locally on Ubuntu for the first time, Apache 2, PHP, MySQL, and PHP My Admin are all up and running fine.

I have been using Gedit to modify pages by opening them after navigating to the /var/www folder using gksudo naultilus. This works fine but I decided this morning that I wanted to use Aptana instead..

Aptana runs fine but when I try to save to anything under /var/www I get a permissions error. I tried giving myself read/write permissions both via terminal (chown) and in gksudo nautlius.. no change.

How can I write to these folders from Aptana? Also, is there any way to link to /var/www from my home folder so that I don't have to keep going there "the long way?"

View 5 Replies View Related

Programming :: Use Echo To Display The Content Of A Variable?

Jan 4, 2010

I have a problem to use echo to display the content of a variable.

This is what I do:

Code:
#!/bin/bash
USAGE="Usage: name [OPTIONS] [DIRECTORIES]"
echo $USAGE

When I run this little script I get the following output:

Usage: name [OPTIONS] R

So I think that [DI might be some sort of escape sequence. But I do not know how to unescape it. Does anyone have a hint for me?

View 14 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 :: Creating A Script To Move Or Copy Files Into Multiple Directories Below The Files?

Aug 25, 2009

How can you create a script to move or copy files from a main directory into multiple directories below the main directory.

View 7 Replies View Related

Programming :: Finding Location Of Duplicate Directories

Jan 8, 2011

This simple task is proving harder then imagined. I have a multi-level directory that I'm trying to clean of duplicates, but I can't get 'find' to print what I need to see. To give an illustrative example, here is a dir:

Code:
stuart@stuart:~/testdir$ ls *
dir1:
level2:
dir1

So the output of find as i'd like it to work would show the two locations of dir1, which would be ./dir1 and ./level2/dir1. But no:

Code:
stuart@stuart:~/testdir$ ls -d */ | head -1 | find . "`cat`" -type d
.
./level2
./level2/dir1
./dir1
dir1/

View 2 Replies View Related

General :: Recursively Cp All Directories, Files And Hidden Files?

May 17, 2010

Ubuntu 10.04

I want to copy all directories, files, and hidden files and hidden directories with one command. I want these items to replace any same items in the target directory.

I have tried several things, such as:

cp -r *
cp -aR *

but I only seem to get visible files and directories. Obviously, I am missing something. (A brain, probably....)

View 9 Replies View Related

General :: Comparing All The Files In A Directory By Content?

Sep 18, 2010

I wish to compare all the files in a directory....comparing is by content. And same files should be printed...

echo "program : $0"
cd $1
for a in *
do

[code]....

This logic did not give the correct result...

View 5 Replies View Related

General :: Automatically Saving Text Files In DOS Format?

Oct 5, 2010

I usually work with plain text files, and when moving them across platforms, the differing format creates problems. I want that whenever I save a file with extension *.txt, it be saved as DOS format, and all other extensions or without get saved as Unix format.

View 2 Replies View Related

General :: Downloaded Files Saving Above And Behind The Panel Menubar?

Apr 26, 2011

I download a file to my laptop desktop, it saves above and behind the panel menubar (Applications / Places / System). As such, the files aren't easily accessible.How might I ensure that downloaded files are visible on the screen and not 100px above & behind it? Perhaps related, I've got a second monitor attached to the laptop (primary). It seems this second monitor's resolution is affecting where downloaded files are put...out of sight.

Primary laptop: Dell Vostro 1310. Resolution = 1280x800
Secondary monitor: Acer 19-inch LCD Flat Panel. Resolution = 1280x1024.

I've tried all the settings in Monitor Preferences to no avail. Searched Google without luck. Currently on Ubuntu 10.10 and the system is (according to Update Manager) up-to-date.

View 2 Replies View Related

Fedora :: Set The Default Java Env Variable To New Installed Location

Sep 7, 2011

I installed new jre in linux. but i when i checked env variable $JAVA, it is showing old version. how to set the default java env variable to new installed location

View 1 Replies View Related

Ubuntu :: Location Of PATH Variable On Netbook 10.10 Maverick?

Nov 13, 2010

I'm trying to install Go (programming language):

[URL]

The installation was OK, but I can't find where the PATH variable is set for 10.10 netbook remix.

Code:

~$ echo $PATH

gives:

Code:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

View 9 Replies View Related

Programming :: Check That The Same File Exists Within Two Different Directories Using A Filename As A Variable?

Apr 30, 2010

I am in need of a way to check that the same file exists within two different directories using a filename as a variable. Here is the process which requires it: The script is reaches out (via ftp) and pulls down a file(s) and delete it afterwards. This is halfhazard because in the instance it doesnt pull down the file, yet still deletes it, we are up a creek. I am looking to pull it down to a temp location and then verify that file exists in the location in which it needs to be present to process before deleting it, adding a little extra layer for security. The script itself is finished.If I put a file name in manually it works perfect. I just need a way to pump the filename into the variable.

View 1 Replies View Related

General :: Location Of .MYD Files?

Jun 29, 2010

We are on a vps with godaddy and i was just curious that where are all the .MYI files saved

View 1 Replies View Related

General :: Find Will Go Through The Content Of Tarball As Well And List All Content

Oct 5, 2010

I am using find to search for .tgz files modified more than 7 days ago and delete them.find /directory/ -iname backup*.tgz -daystart -mtime +7 -exec rm -rf {} My problem is that find will go through the content of tarball as well and list all content. I want to only search main tarball and delete it if older than 7 days.

View 4 Replies View Related

General :: Location Of C Header Files ?

Jan 30, 2011

I'm trying to install vmware tools in mint.

All goes well until I get to this -

What is the location of the directory of C header files that match your running kernel? [usr/src/linux/include]

When installing the vmware tools it says to just hit enter and the default will be used.

Hitting enter just keeps giving me the error message- The path "usr/src/linux/include" is not an existing directory.

View 14 Replies View Related

General :: Merging Two Files From Two Different Directories?

May 14, 2011

I'm totally new to Linux and this website. I was wondering if anyone had or could help me create a shell script that would merge two files from two different directories and then have that new merged file in a third differnt directory.The merged file would need to eliminate duplicates and sort the contents.

View 6 Replies View Related

General :: Remove Directories That Only Contain .txt And .log Files?

Aug 8, 2010

I'd like to remove all directories of a certain depth that don't contain .txt or .log files -- is this possible? So far I have: find ~ -mindepth 3 -maxdepth 4 -type d -exec rm -r '{}' ; Is it possible to add in "only if the directory doesn't contain .txt and/or .log files"? Or do I have to start learning perl to do that?

For example:
dir 1:
hello.txt
runme.sh
dir 2:
runme.sh
oct12.log
[Code]....

View 13 Replies View Related

General :: Dividing Content Of One File By Content Of Another?

Apr 12, 2011

If you have the value 100 in File1 and the value 5 in File2, how do you write a script to divide the 100 in File1 by the 5 in File2 in Linux Bash Shell?The operating system I am using is Ubuntu 10 and object is to write a script to accomplish this task.

View 5 Replies View Related

General :: Location Of MySQL Log Files On Ubuntu

May 11, 2011

I would like to delete the MySQL ib_logfile but do not know where the files are located on my machine. I am running the latest version of Ubuntu.

View 1 Replies View Related

General :: Find The Location Of The Files Listed Using Rpm -qa?

Feb 24, 2011

does any one have any idea how can I find the location of the files I listed using rpm -qa?

eg, 1 of the result returned from rpm -qa is yum-3.2.22-20.el5 how can I find the location of this program?

View 4 Replies View Related

General :: What Kinds Of Files Are Stored In The Directories

Mar 12, 2010

3.State what kinds of files are stored in the following directories. Give any ONE file that can be found in these directories.

a. /etc/
b. /proc/
c. /sbin/

View 2 Replies View Related







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