I am suppose to make a program that cuts the extension off of a file. It uses that .ext to decide which program needs to be used to open the file. This only finds the name of the program from a list of programs I made. My problem is when it has the name of the program it needs to use, how can I make the program open the file with code in the script.
This question is a sequel of sorts to my earlier question. The users on this site kindly helped me determine how to write a bash for loop that iterates over string values. For example, suppose that a loop control variable fname iterates over the strings "a.txt" "b.txt" "c.txt". I would like to echo "yes!" when fname has the value "a.txt" or "c.txt", and echo "no!" otherwise.
Hey , guys I am new to shell programing ,, so need a help from you guys ...
I have to write a shell script that accepts file name or directory name from the user if it is a directory then throw an error if it is a file then give the user two options .
1.overwrite the content
2.append the content
Here is my program ..
I think I know what this is doing, but the 'eval' is confusing
Code:
fname=$(echo ${lineItem} | awk 'BEGIN {FS=";"}{print $1}')
fname=${fname%%+([[:space:]])}
fname=${fname##+([[:space:]])}
eval "fname=${fname}"
The first line extracts the contents of the line preceeding the ";"
2nd & 3rd lines trim the value (I think ..
I have made a simple script to zip a file then first copy it to a specific directory using cp command then move it to another directory. Files are getting generated at regular intervals in the dir. /one/two/three/four/.
Found myself stuck on this seemingly trivial issue. I have this script which call other shell files to do their deeds. The shell files in turn call some other programs as well. My problem is that in two of these shell files, the control doesnt return to next command in script unless the Enter key is pressed.
Okay, I have the following problem:
I have a file (.jnlp, but that isn't important) that I want to open with a certain program (javaws). Problem is that the program I want to open it with is not diosplayed in the list of programs when selecting Open with in the right-click menu.
Rather than reinvent the wheel, if anyone knows a shell program which does this well ,please recommend
my bash / sed program is failing at the 'mv' to the new filename
it splits the original filename into multiple tokens
my loop is as follows:
Code:
echo "extension:"
read ext
ls --quoting-style=shell *.$ext | while read x ; do
n=`echo $x|sed -e "s/$ext//"` # reserve
I am new in Fortran. Can anybody tell me why I cannot read a string from the txt into NAME
The first row of the txt file contains "Line". When I print NAME.