So, I’m using a script I’ve made to convert videos to the webm format. A certain program calls the script, sending %f
which is the full, absolute file name of the video, like this:
Simple question, but I’m not sure where to look and google doesn’t respond to periods and slashes.
Is there a Unix command to get the absolute (and canonicalized) path from a relative path which may contain symbolic links?
I know that I can change the file a program writes to by interrupting the process in gdb, closing using the file descriptor and then re-opening with the file name I want. Is there a way to do the same thing at run time?
What I am doing is converting mp3’s with LAME. I already have an old script I wrote that works but I want to add to it this ability–to no longer delete the file but instead save it in a new root folder with sub-directories that match the using the path that it is already in.
I understand and accept the premise that defensive1 shell scripting is both prudent and, in the longer term, more sustainable.
In Bash, suppose I visit a directory, and then another directory. I would like to copy a file from the first directory to the second directory, but without specifying the long pathnames of them. Is it possible?
For the purpose of testing, I’d like count how many images files are inside a directory, separating each image file type by file extension (jpg=”yes”. This because later it will be useful for another script that will execute an action on each file extension). Can I use something like the following for only JPEG files?
I was working on a shell script and I accidentally created a file with the variable as its name. Now I have $file
in my ls
output, and cannot remove it. What can I do?