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.
Hello,
I understand that to run a shell-related command like history inside a shell script you should do either source script.sh or . ./script.sh, because otherwise it gives the history of the shell forked by the shell script, which is basically blank.
But I would like to know how I can run this nside a C program. Normally I do system("./script.sh").
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.
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
Hi,
We are having a java server which can run on command line and once initiated, it will prompt options to enter from 0 to 5. The java program kickoff respective operation once number is entered between 0 to 5.
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 have a USB formatted in FAT32, and I use my usb to hold most my files because my ubuntu installation is only 7gb. The only problem is, programs on it will not execute. I have managed to get around this using shell scripts, except now I have come across something I cannot use a script to get around.
I am trying to use the android sdk for linux.
I am writing a shell script to uncompress files in a directory, then call a Perl script to search the files for given terms, store those terms in a different output file , and compress the output. I get a syntax error with my use of foreach. Below is my script.
Code:
#!/bin/csh -fxv
if (!
Hello please kindly solve these doubts i have about the following scripts
Code:
Script 1
//Shell script that accepts arguments and prints them in reverse order//
echo "number of arguments"
len=$#;
while [ $len -ne 0 ]
do
eval echo \$$len
len=`expr $len - 1`
done
---------
Output
$sh test.sh a b
b
a
1.what is \$$len.what is the significance of the escape sequence
Script 2
Cod