General :: Unable To Get Basename Of File Without Extension
Mar 4, 2011
Trying to get the basename of a file without the extension, I found this snippet but it just returns command not found twice:
[Code]....
Also tried (with and without the quotes on input and file_ext):
input=$1
file_ext=.${input##*.}
base=`basename "$input" $file_ext`
executed: convert.sh /path/music.wav But it echoes base as music.wav
View 14 Replies
ADVERTISEMENT
Mar 12, 2011
Quote:Originally Posted by SimonJM It almost smacks of your script being wrapped up in something elseGot it sorted, did the logic in PHP and linked directly to ffmpeg
View 2 Replies
View Related
Oct 20, 2010
I have a considerable number of files in a subdirectory (some fascinating old military clips from archive.org - search on Big Picture if interested). Anyhow, I am downloading them using Internet Download Manager running in an XP virtual machine in VMWare on my Ubuntu 10.04 PC (due to the queuing, restart and speed capabilities of IDM). But I digress - the files are being saved on the host (Samba share) without a file extension. So I have a collection of files with names like
Quote:
The Douglas MacArthur Story
THEY WERE THERE (1960)
I wish to add the extension ".mp4" In Windows this is simply done with the command
Quote:
rename *. *.mp4
This of course does not work in Linux. I have researched the Linux rename command and reviewed a lot of examples. However, I have not found a way to add an extension to a batch of files which are named with no extension to start with. The spaces in the file names also seem to present an issue. At the moment I am renaming them from the Windows VM while they are sitting on the Samba share using the ancient File Manager program from Windows NT which works great on XP. I have experimented with the file rename facility in Gnome Commander however, it does not seem to want to do something so simple.
View 10 Replies
View Related
Apr 23, 2011
I want to install Forms & Reports Developer Suite in Linux OS So I have downloaded Oracle Developer Suite 10g for Linux (Including Forms & Reports)
as_linux_x86_ids_101202_disk1.cpio
as_linux_x86_ids_101202_disk2.cpio
So in the Oracle Documentation Site they have given Guide as Follows:
To extract the cpio file,
move the cpio file to an empty directory,
then do:
cat filename.cpio | cpio -icd ....
but its not extracting.
View 7 Replies
View Related
Mar 2, 2010
I am trying to access a .dd file extension. Do I have to mount it?
VMware-VMvisor-big-3.5.0_Update_2-110271.i386.dd
# fdisk -ul VMware-VMvisor-big-3.5.0_Update_2-110271.i386.dd
Blocks Id System
VMware-VMvisor-big-3.5.0_Update_2-110271.i386.dd1 8192 1535999 763904 5 Extended
VMware-VMvisor-big-3.5.0_Update_2-110271.i386.dd4 * 32 8191 4080 4 FAT16 <32M
VMware-VMvisor-big-3.5.0_Update_2-110271.i386.dd5 8224 106495 49136 6 FAT16
[Code].....
I am trying to grab some files off this file to create a PXE vmware boot.
View 2 Replies
View Related
Aug 8, 2011
#!/bin/csh -f
source /xxxx/
set $spicedir = `sim_${1%.*}`
printf "Output folder is %s
" $spicedir
toolcommand -i $1 -o $spicedir
(-o output directory, -i =input)
I got spicedir: Undefined variable in my xterm
How could I match a file name without extension in csh
View 1 Replies
View Related
Apr 26, 2010
How will I open a file with extension .pmd in linux ?
View 7 Replies
View Related
Apr 18, 2011
I am playing with my LAMP server1. why can i access a php file on the server only by typing http://serverip/file with no .php extension on?2. later i tryed to play with .htaccess, but when i uploaded it to the server it just disappeared, why is that
View 4 Replies
View Related
Dec 9, 2009
how to use a variable in a sed command, but I can't get the output into a variable.
FILE=readme.txt
now i want to remove the extension of filename
so file woud be:
FILE=readme
my script:
NFILE=`echo $FILE | sed 's/.txt//'`
mv ../out/$FILE ../out/$NFILE
FILE=$NFILE
now when i run my script. i get this unknown character extensions in my new file(NFILE).
View 14 Replies
View Related
Mar 27, 2010
I have been trying to compile a pascal file using fpc. I succeeded using the command fpc pas1.pas, but this gave me a new object file pas1.o. How do i compile this file to get my output. gcc -o pas1.o does not work.
View 2 Replies
View Related
Nov 3, 2010
I know this is possible in GUI gnome. But is it possible to do it too in shell command? Let say if i type this in shell:
#file.txt
then it will open gnome-editor in nautilus which open file.txt. gnome is the desktop manager. nautilus is the explorer windows in gnome. gnome-editor is one like notepad in MS windows.
View 1 Replies
View Related
Aug 26, 2009
How do you rename:
abc123.txt
abc124.txt
abc125.txt
to
abc.txt.123
abc.txt.124
abc.txt.125
Basically, I want to move the digits from the filename to after the extension.
It works for one file if I type:
rename 123.txt .txt.123 abc.txt.123
but I have thousands of files like these.
View 1 Replies
View Related
Oct 3, 2010
Many years ago, I converted a portion of my files to an arbitrary format with a specific extension. i no longer desire to have them in this format and i would like begin the process of replacing them because conversion is not an appropriate solution. unfortunately, they are mixed in separate folders of the same root folder with files in my current format of a different extension. I feel it would make this process easier if I were to move every folder that contained a file with the undesired format to a separate root folder. The files are stored on a Linux server and shared via samba. How can I do this with a couple of commands or a script? I am open to other suggestions as well. I want to avoid time spent editing text files. Ultimately, I'd like a command that produced a list of full paths for folders, sorted by the number of levels would be a nice touch. A list of all of the files is clearly not what I'm looking for.
View 2 Replies
View Related
Jan 18, 2010
have a gzip file ABC_000023232.gzipBCD_023232032.gzipI want to split these files into smaller files but keep the extension same because I am using this as a variable in a script
Code:
for i in `ls *.gzip`
split -b 500K $i $i
[code]...
View 3 Replies
View Related
Sep 11, 2009
The os i am using is RHEL5.
I have problem in installing software with the extension ".tar.gz" or".tar.bz2" .
First if we extract from a media ,how can we specify the destination folder"?
Is extracting by commands and with archival roller same?
After extracting what should we do to install?
View 4 Replies
View Related
May 6, 2010
Anyone know how to compress a file to extension z?not tar.gz , zip, 7zip
View 6 Replies
View Related
Jun 17, 2011
I get this behavior on Slackware 13.37, which includes BASH 4.1.010. Yes, BASH is my shell. I have a file called a.flac and I'm in the directory that contains it.
The output of the ls command is expected:
Code:
ls *.flac
gives:
Code:
a.flac
Removing the extension with basename works as expected:
Code:
basename a.flac .flac
gives:
Code:
a
Putting the above command in a variable substitution works as expected:
Code:
echo `basename a.flac .flac`
gives:
Code:
a
Using xargs with ls and a variable substitution works as expected:
Code:
ls *.flac | xargs -i echo `echo {}`
gives:
Code:
a.flac
However, when I try to add the basename command to the above command, it stops working.
Code:
ls *.flac | xargs -i echo `basename {} .flac`
gives:
Code:
a.flac
Whereas the result I expect is:
Code:
a
Why is it not working, and how do I make it work?
View 3 Replies
View Related
May 7, 2009
I have a CentOS 5 server with PHP 5.1.6 installed. Now I need to work with soap but the extension is not installed by default.Preferably without recompiling (if possible) ? Specific instructions would be very helpful.u Also, if you need any further information, let me know.
View 6 Replies
View Related
Aug 19, 2010
Enterprise Linux 4 (2.6.9-78 kernel)...rename not working! Need to insert "_T" at the end of every file in a directory, just before the ".extension"
I have tried sed substitution with no success (because I do not know the codes and effects of anchoring well enough).
An example filename:
My failed tests:
Code:
Code:
Code:
Code:
View 9 Replies
View Related
Sep 10, 2010
I trying to read a file with an .odc extension.Using openOffice Calc, However there is a of garbage and irreadable characters, I found out it is a Microsoft office data connection file. Is there a way around it?
View 4 Replies
View Related
Jun 26, 2010
How to open and run file with extension nds in ubuntu linux?
View 1 Replies
View Related
May 5, 2011
I installed Minecraft and I want to hide the .JAR extension on the file on my desktop. I tried just renaming it and deleting the ".jar" from the name, but when I tried opening it, it opened as an archive, rather than an executable, even though I had the "Allow executing file as program." box checked off. What can I do to hide the extension?
View 1 Replies
View Related
Apr 2, 2010
How to make sure that when I save a pdf file, the file extension .pdf appears in the filename? Its a silly little thing, but annoying. The file browser recognises it afterward as a pdf file though, it opens with document viewer ok.
View 9 Replies
View Related
Apr 24, 2010
I am running 10.04 beta2 and have installed cups-pdf printing. I can print to the PDF printer and it works fine saving the file to ~/PDF. It saves it with the PDF extension as expected. I am trying to save the file by default to a windows share. I changed the DEVICE URI line to smb://HOME/SERVER/PDF. When I print, the job shows up on the windows share but without a PDF extension
View 8 Replies
View Related
Jul 8, 2010
I have received a file in CDF V2 format (.pub file extension).
Is there any software available to read this file in Linux (Ubuntu)?
View 2 Replies
View Related
Aug 2, 2010
When trying to play videothe extension .vob,the following message :pa_stream_writable_size () failed. Connection terminated. I tried to follow the tread associated with that error message with little luck. Following that thread led to the following command:sudo pulseaudio --killWhen I executed that command I got the following:E: core-util.c: Home diectory home/username not oursE:main.c: failed tokill daemon: permission denied
View 6 Replies
View Related
Mar 6, 2011
I am trying to move files from one folder to another based on their file extension. I can do it with a single extension, but I want to match multiple.
Example:
This works, but I want it to not only match mov, but also mpg, flv, mp4, etc. I would think something like [mov,mpg,flv] would work, but it doesn't.
View 4 Replies
View Related
Jan 4, 2010
As we have executeable file extensions .exe , .msi and .msp for Windows. What is the file extension that is executable in Linux RHEL 5
View 3 Replies
View Related
Feb 8, 2010
All files I save, now have to have the OTS file extension, and I cannot open them directly. I have to go through Open Office Org. My computer has also slowed down. Whether this is associated I don't know. Could this be a Bug, and if so how can I correct this problem?. My OS is Fedora 10.
View 2 Replies
View Related
Sep 15, 2009
Platform information:
Fedora 11
HP a1250n PC w/3Gb RAM and 2Ghz (?) CPU
PHP v5 and Apache 2.2
The situation I've got is that my PHP and Apache installs do not recognize files with the .php5 file extension. I can successfully open .php files in my browser just as I have designed them. However, when I try to open a .php5 file in my browser, it simply outputs the code and not the web page (as it should). I've pasted (what I believe to be) the relevant parts of the output from phpinfo() command below. Any help correcting this is greatly appreciated as I have searched the forums and the Internet fairly exhaustively with various different keywords and still have come up empty. I think if I could figure out how to add ".php5" to the list of "Registered PHP Streams" then I would be all set, but I can't figure that out. I also tried copying /etc/php.ini to /etc/php.d/ and re-naming it php5.ini, but this did not work.
Clem
Configure Command
'./configure' '--build=i386-redhat-linux-gnu' '--host=i386-redhat-linux-gnu' '--
[code]....
View 3 Replies
View Related