I have an executable that processes under the basic premise of:
However, we often create statements like the following:
or even:
Please note that the paramaters can have variable text, there can be more than one set of parameters, but they must be inside double-quotes.
My problem is that I need to modify the file permissions on the file_out. When I thought that the first example above was the only way to run, that was easy since I could do a:
But, my FILE_OUT could be at $2 or in the above examples $6 or in lots of other places.
I was thinking of outputting each $variable to a file, grep to exclude the " lines, and then the last line would be my output. However, the following code is not maintaining the " symbols; thus I cannot grep.
program file1 + file2 + file3 fileout "parm1 a b" "parm2 b d"
My output $temp_file looks like:
Thoughts anyone?
Switch files and parms on the command line since what you have is a non-standard implementation. According to the standard parameters must precede files that are provided on the command line implying that the output file would be the last one on the command line.
The order shown is the order the line must be in. I am trying to front-end an existing executable, and that executable is requiring the input to be laid out in that manner - I wish I could change the order of the input parameters.
But, I must follow the:
How about testing for the existence of a file and shifting the command line parameters conditionally??
The input files should all exist (barring typos or errors) but the output file doesn't as it will be created after processing through the executable. Is that a correct assumption??
I modified your while loop based on that premise...
Hi,
I am using awk here.
Inside an awk script, I have a variable which contains a very long XML data in string format (500kb).
I want to pass this data (as argument) to curl command using system function.
But getting Too many arguments error due to length of string data(payloadBlock).
I... (4 Replies)
Hi,
I know with getopts you can pass arguments from the command line
./script -ab -c apple
But it doesn't support 2 or more arguments for ONE option. Is there any other way to do this?
Thanks (2 Replies)
Hi,
i have a file.txt with data
Bangalore
Chennai
Hyd
filename of the script is: new.sh
result=`cat file.txt | grep $1`
if
then
echo pass
else
echo fail
fi
i am executing the file in the cmd line as "sh new.sh Bangalore"
o/p is pass
if i give "sh new.sh delhi"
o/p is... (6 Replies)
I have an for loop that reads the following file
cat param.cfg
val1:env1:opt1
val2:env2:opt2
val3:env3:opt3
val4:env4:opt4
.
.
The for loop extracts the each line of the file so that at any one point, the value of i is
val1:env1:opt1 etc...
I would like to extract each... (19 Replies)
Is there any way I could pass arguments to shellcode. My goal is to store a program in a image file, and have another program read and run the code with arguments in memory.
Currently I can store a program in a image file, then read it back to the hard-drive run it normally then delete it when... (5 Replies)
Hi,
How do I print a line with symbols in a file?
Exp:
If I want to print line: Hi "Lisa;John"
Command:
print FILE "Hi "Lisa;John""; - will give me error Bareword found where operator expected...
Can someone advise how can I print any line consiting symbols like example above. Thanks... (3 Replies)
I need to pass arguments to a shell script.My batch is calling some java program.
#################
x=$1
y=$2
java -classpath program
###################
if first parameter and second parameter is null then
java -classpath program
if first parameter is not null and second parameter is... (3 Replies)
Hi
I have a script to which I pass multiple arguments, for example lets say the script name is "abc". I run the script like
./abc def /file <directory location>
In the above "def" is the first argument and "/file" is the second argument. I expect <directory location> that is passed after... (4 Replies)
Hi,
I have a script which adds the user credentials to an ldap server. Im passing the variables as below..
/path/my_script $uname $pwd $environ ${deposit}
If i enter some special characters like ';' in $pwd, script returns an error which is set to display if the user enters... (5 Replies)
I'm trying to pass a filename, or all the files in the current directory to the ls command with a script. Unsuccessful so far, here are a few of my attempts:
#!/bin/ksh
read fname
#if (( $# > 0 )); then
$fname | ls -l
#fi
this produces a long listing of all the files in my current... (4 Replies)