Programming :: PHP - List Directory - Choose A File - Change Its Name

Mar 16, 2011

Im looking to use PHP to list a directory. When I click on a filename, I'd like it to automatically remove the first 16 characters off of the filename and save it to the filesystem.

View 6 Replies


ADVERTISEMENT

Programming :: Bash/Perl Script - Provide List Of Hosts To Choose From And Ssh To Chosen Host?

Apr 6, 2010

I'm not sure if this is best done in Perl or Bash. I'm thinking surely someone else has created something close to what I'm looking for. The results of the script would be that someone would kick off "linux_hosts.sh" r whatever you want to call it, then a top "folder" of options (with hosts contained within each of these top menu choices), then, based on which number corresponds to that top level, they're presented with a set of linux hosts that are relevant to that top level name. Example:

$ linux_hosts.sh
1. VMware hosts 4. Private Domain
2. ESX servers 5. Red Hat boxes

[code]...

View 4 Replies View Related

Programming :: How To List Contents Of Directory And Exclude Any Subdirectories

Aug 2, 2010

I'm having trouble figuring out how to list the contents of a directory and exclude any subdirectories.

View 5 Replies View Related

Programming :: List Only Hidden Files In Current Directory?

Feb 15, 2010

How to list only hidden files in current directory ?

View 2 Replies View Related

OpenSUSE :: Choose Repository From The List?

May 28, 2011

I am confused by the repositories list from the community as following:

View 9 Replies View Related

General :: Scripting - Move A List From A Text File To Directory ?

Jan 10, 2011

I'm sure I've done this before and am having a brain fart.

I have run into this a couple of time this last month:

I have a list of torrent files (blahblahhexblah.torrent) saved in a text file. I would like to read the text file and populate the client directory.

I can echo the file using:

But I cannot remember how to pipe the output into the directory, nor can I find any resources that describe the process.

Interestingly enough, I've had a couple of opportunities to do similar tasks with passwords and privileges and even across the LAN in the last few days. Solving this problem will help me solve the others for next time.

View 2 Replies View Related

Ubuntu :: Change The Default File Browser View From Icons To List?

Jul 13, 2009

Is there a way to change the default File Browser View from Icons to List?

View 6 Replies View Related

Ubuntu Installation :: Went To Boot Into Windows... And Noticed The Option To Choose It Is Missing From List?

Apr 2, 2010

I'm testing out 10.04 on one of my partitions, and I love it. I have been using it exclusively for a while now, I have not logged into Windows since! Really don't care about windows anymore!However, yesterday I went to boot into windows... and I noticed the option to choose it is missing from my list! Maybe I'm just not getting to the correct list? The list I get shows like 5 different modes and versions of Ubuntu and something called Windows Recovery (which does nothing), but that's it.

View 9 Replies View Related

Programming :: Change Directory In System With Java?

Mar 12, 2011

I am trying to run the configure command to install a package in linux with Java. Now my workspace location of Eclipse project is /home/user/Workspace/projectx. The source package say zebra is located in /project/test/zebra. Now there is a configure script which I want to run using java and all the outout files will also be created in /project/test/zebra.
Now in Java the code I am using runs the configure command but all the files it creates in current workspace of project which is in /home/user/Workspace/projectx directory.
Now as I tried to do 'cd' command but as it's internal command of linux so it doesn't work and I don't know how to make it work. code...

View 8 Replies View Related

Programming :: Source Code For Cd - Change Directory

Feb 9, 2010

I want to modify the source of cd (the 'change directory' command) to do a little extra for me, but I can't seem to find the source code anywhere.. maybe I didn't look for it well enough, and googling "source code cd" and variants of that doesn't exactly help... I was wondering if anyone knew where I could find the src?

View 14 Replies View Related

Programming :: Create Cvs From List Text File

Dec 21, 2010

I have a file with 5000 lines. it is a list of books authors, series and titles. all lines start with the author names, than there is a dash (-) than the series name, a dash again and the title of the book.

The problem I encounter is that sometime there is a series, sometime not, and as I try to enter this list in a database, I wanted to create a cvs file to import into mysql.

ex:

The best would be to be able to add in the second line, a "space dash space" just after the author name, but how to make sure it does not do it to the first line as well.

If I could separate all line with 2 dash, (grep ?) then I would be able to do a simple replace, and change the single dash into two.

View 2 Replies View Related

Programming :: Take A List From A File And Use It In A For Loop In Python?

May 11, 2009

so far I have this

list = open('list.txt')
for x in list:
list.read(x)

View 3 Replies View Related

Programming :: OpenCV Programming - Highgui.h: No Such File Or Directory?

Jul 1, 2010

I installed OpenCV and am trying the example programs. When I try to compile like in the tutorial it is not finding highgui.h.I have 64 bit Mint if that helps at all

View 3 Replies View Related

Programming :: Libmpi_f90.so.0: Cannot Open Shared Object File: No Such File Or Directory

Aug 6, 2010

I am running after compiling a program and I find that I get the following. How best can I avoid this as i cannot run the program. I have tried removing the offending package, although I cannot find it. I have also tried re-installing. I have also tried changing FC and F90 flags to avoid the MPI version.

error while loading shared libraries: libmpi_f90.so.0: cannot open shared object file: No such file or directory

View 1 Replies View Related

Programming :: Make A Folder For Each File In A Directory Then Move The File Into It

Nov 29, 2010

Initially I thought - use a for loop with ls in it:

Code:

However this causes lots of problems (folders have extensions, I have duplicate folders, the names with spaces create a folder for each element of the name).

The contents of the folder is basically movies (some with subtitles). Some of the names have things like (original) or CD1 CD2 in them.

View 15 Replies View Related

Programming :: Change Current Working Directory Through A Perl Script?

May 2, 2010

how can i actually switch to another directory with "chdir" in perl.like the we used to do is bash as:

Code:
$cat abc
cd Desktop/

[code]...

View 1 Replies View Related

Ubuntu :: Unable To Change File To Directory?

May 10, 2011

I have a usb that got corrupted whilst attached to a Vista computer.Now what was once a directory is now a file!It now reads as -rwxr -xr -x instead of drwxr -xr -x how do I change this back to a directory?

View 2 Replies View Related

Programming :: Get A List Of File Install Locations With Make It?

Dec 21, 2010

I have a bit of a problem and the only solution I can think of at the moment is a very tedious one, so I was hoping there would be a better way. What I am trying to do is cross compile the PPPD program so that I can install it on an embedded system (this system does not have make/gcc on it). It was easy to cross compile it, but I can not run "make install" since I'm compiling on a secondary machine. I don't want to install PPPD on this secondary machine (I couldn't anyway, because it was compiled for a different architecture) and I can't run make install on the target machine because there is no make/build system for it.

So it seems like what I would have to do is to manually copy over each compiled file from the build machine to the appropriate location of the target machine. And the only way (that I know of) to figure out how to do this is to manually examine the Makefiles (yes, there are several for PPPD) and figure out which file should go where on the target system. This isn't trivial because it uses a hierarchy of makefiles and the probability of human error for this method is high.

Is it possible that I could run another command that would give me a list of all the commands that make install would perform? Or a list of all files and their target location for "make install"? Or possibly some other solution that I am completely unaware of that would make this task not so painful and error prone?

View 8 Replies View Related

Programming :: Store Line From Text File Into List C++

Feb 6, 2011

I'm wondering how it is possible to read each line from a text file, and then store each line separately in a list, using C++?

View 2 Replies View Related

Programming :: HUGE Files - Compare A List Of Patterns From One File And Grep Them Against Another File And Print Out Only The Unique Patterns?

Aug 13, 2010

I am trying to compare a list of patterns from one file and grep them against another file and print out only the unique patterns. Unfortunately these files are so large that they have yet to run to completion. Here's the command that I used:

Code: grep -L -f file_one.txt file_two.txt > output.output Here's some example data:

Code:
>FQ4HLCS01BMR4N
>FQ4HLCS01BZNV6
>FQ4HLCS01B40PB
>FQ4HLCS01BT43K
>FQ4HLCS01CB736
>FQ4HLCS01BU3UM
>FQ4HLCS01BBIFQ

how to increase efficiency or use another command?

View 14 Replies View Related

Fedora :: BASH :: Change File Stat In Sub Directory?

Oct 23, 2010

So I have created a Bash script with the intent of the program to change the names of the files in a folder's subdirectory.The code recognises the individual subdirectories, then is able to enter into one and list the files individually, but when it tries to change their information it says;' cannot stat ' : ' No such file or directory 'As if it is looking in the directory that contains the Bash script, not its subdirectory.It is essentially saying, I see a file here called FILE but sorry, I can't change FILE because FILE doesn't exist. kweh?Is this something outside the capabilities of Bash? Am I asking too much of it? Can Bash only manipulate files that are in the same folder as the script?

Code:
#!/bin/bash
echo enter directory

[code]....

View 6 Replies View Related

General :: How To Change Same File Names Directory Wise

Apr 9, 2010

I have a problem with file names changes. I have a hundred of file with same names and different subdirectories. I want to change that file names by their subdirectery names.

Currently is:
file name------------------------subdirectory name
1_km_16_days_EVI_s2_01200_01200.img --> MOD13A2.A2000049.h23v03.005.dir
1_km_16_days_EVI_s2_01200_01200.img --> MOD13A2.A2000065.h23v03.005.dir
1_km_16_days_EVI_s2_01200_01200.img --> MOD13A2.A2000081.h23v03.005.dir
...

I want to
MOD13A2.A2000049.h23v03.005.img
MOD13A2.A2000065.h23v03.005.img
MOD13A2.A2000081.h23v03.005.img

View 3 Replies View Related

Debian Programming :: Searching For A List Of Strings In File With Python

Oct 14, 2013

I'm trying to search for several strings, which I have in a .txt file line by line, on another file.

So the idea is, take input.txt and search for each line in that file in another file, let's call it rules.txt.

So far, I've been able to do this, to search for individual strings:

Code: Select allimport re

shakes = open("output.csv", "r")

for line in shakes:
    if re.match("STRING", line):
        print line,

How can I change this to input the strings to be searched from another file?

So far I haven't been able to.

View 3 Replies View Related

Programming :: Use Zenity In A Bash Script To Display A .csv File Using '--list'?

Jul 22, 2010

I'm trying to use zenity in a bash script to display a .csv file using '--list' to allow the user to edit some of the values.I can display it fine but i'm unsure how to edit the data? all i can get is whichever line is highlited when hitting ok on the zenity dialog to print.the data in the csv is arranged:

<prod>,<disc>,<qty>,<type>,<location>

View 1 Replies View Related

General :: Modify The /etc/host File - Change Directory Fails?

Feb 1, 2010

I am in the process of setting up an Asterisk server with Broadvoice services. I am having issues with making outbound calls and Broadvoice suggests I modify the /etc/hosts file in order to add their proxy server IP address and name. I login to my server as root and get the following command line header

[root@root tmp]#

I entered cd thinking this is what I need to change directory but fails. What is the command I need to enter in order to get to the /etc/host file so I can change it? How do I confirm an /etc/host file even exists?

View 2 Replies View Related

Programming :: Can't Open File - No File Or Directory

Jul 2, 2010

When I hardcode abc.bin to inputFileName - I can open the file in cpp. But when I pass the same using an optional argument, it fails. Note that in both cases, fprintf, prints the inputFileName as abc.bin properly.

I get can't open - no file or directory.

Code: main()
{
char * inputFileName;
char * optarg;
inputFileName = optarg; //doesn't work.

[Code].....

View 2 Replies View Related

Software :: List Files/directory Names Without Directory Contents?

May 3, 2011

When I run "ls -al somedir*" (I use the "ll" shortcut, actually), Linux not only list files that match, but also the contents of directories whose name also happens to match.Is there a way to limit "ls" so that it will only show names (files and directories) and ignore the contents of the directories?

View 2 Replies View Related

Installation :: Change The Boot Partition - Error: Bad File Or Directory Type?

Jan 31, 2010

I have presently a (working) boot dedicated partition, where grub stuff resides, but I want to change it to a common "/boot" folder in the root partition (in a different hdd). For some reason I can't do it. The first thing I did was to copy all the things that are in the boot partition to a boot folder on the root partition. After that, I tried: grub-install /dev/hdc1 (which is odd but it's where the root partition actually is)

When I did it from the linux I have installed on my hdd, it actually did something, I don't remember all the output (except that there was something about it not being able to access hda, which is oddly the dvdrom), but it didn't work. From a live CD, the same command (grub-install /dev/hdc1) is answered with: Could not find device for /boot: Not found or not a block device. From grub's own prompt, the things are more or less the same. First of all, it does not find stage1, even though I did copy the content from the boot partition to a boot folder in the root partition.

I tried to proceed, anyway, with root (hd1,0) and setup (hd1,0) (which is /dev/hdc1, according with the "geometry" info given by grub). "Root" is accepted, but "setup" is answered with: Checking if "/boot/grub/stage1" exists... no Checking if "/grub/stage1" exists... no Error 2: Bad file or directory type But the files are there. I can't "cat" the menu.lst from grub though, unlike with the actual working boot partition. The same error message. From the terminal, however, it's all there. I tried with /dev/hdc1 both mounted and unmounted, the same message. So, basically I have two questions, I guess:

1 - can I really do this sort of thing running a linux installed on a hdd, rather than a live cd, or is the live cd preferable for some reason?

2 - what am I missing?

(A note that may worth making is that I'm using the soon-to-be deprecated grub version, 0.9 or something, not grub2. I think it shouldn't be a problem since I've installed the system with the old version to begin with, but that may be irrelevant, I don't really know)

View 6 Replies View Related

Debian Programming :: No Such File Or Directory

Sep 18, 2015

I’m new to C programming so I wrote the following program to see if everything I needed to write programs with GCC and the standard C library was already installed. I am having issues in OS 10.10.5, where I am unable to build and compile some simple code, either using Xcode or Sublime text. I decided to install Linux Mint in Virtual Box to see if it would work.

Code: Select all#include <stdio.h>
void main()
{
 printf("Hello! This is my first C program with Linux Mint
");
}

For some reason, I'm getting the following error:

mint@mint-VirtualBox ~/Desktop $ gcc hello.c -o hello1
hello.c:2:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>

[code]...

View 8 Replies View Related

Programming :: Error: Gtk/gtk.h: No Such File Or Directory

Feb 13, 2011

gcc kk.c : kk.c:1: fatal error: gtk/gtk.h: No such file or directory compilation terminated.

View 1 Replies View Related







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