Search Results

Search: Posts Made By: Ray Sun
9,807
Posted By Ray Sun
Incorrect number of command line arguments and missing required files
I am developing a script. This script takes in one parameter which is the name of a file whose content is a list of names of some files. The script can check whether those files exist in current...
1,904
Posted By Ray Sun
Weird Exit Status of shell script
I have a script named check which will read the content of a file and check wether those files exist in the current directory. If so it will have the exit status of 0, otherwise it will have 1....
2,799
Posted By Ray Sun
Wow, that's excellent! Now I understand the...
Wow, that's excellent! Now I understand the differences. But, how should I modify my program to get the standard input from input.in?
2,799
Posted By Ray Sun
program file contains: echo $2 $1 input.in...
program file contains:
echo $2 $1
input.in file contains:
a b

When doing:
./program < input.in > output.out
The output.out was empty
However, when doing:
./program `cat input.in` >...
2,799
Posted By Ray Sun
I am sorry, I can't understand why ./program <...
I am sorry, I can't understand why ./program < input.in > output.out redirects the outputs to stderr? And I also tried the following code:
./program `cat input.in` > output.out
This time, it works...
2,799
Posted By Ray Sun
'program' is the name of the script I want to...
'program' is the name of the script I want to run. The parameters of this script is in the input.in file. After running that script, the results are dumped into output.out file.
2,799
Posted By Ray Sun
Use the content of a file as standard input
I want to use a content of a file as standard input to a program and dump the output to a file. However, when I try the following code:
./program < input.in > output.out
The output.out is empty....
2,305
Posted By Ray Sun
Excellent! Thank you so much!
Excellent! Thank you so much!
2,305
Posted By Ray Sun
Can I understand the code in the way that the...
Can I understand the code in the way that the first star (*) in */*.c refers to all the direct subdirectories in the current directory?
Thanks!
2,305
Posted By Ray Sun
Globbling files in the direct subdirectory of the current directory
I want to list files that end with .c in the direct subdirectory of the current directory. I have tried the following command:
find ./ -mindepth 2 -maxdepth 2 -name "*.c"
Is that right? Or is there...
1,617
Posted By Ray Sun
It seems it works perfectly fine. Can I...
It seems it works perfectly fine. Can I understand the code in this way that [!A]?* filters those files not start with A, however, have at least two characters and A[!B]* catches those files start...
1,617
Posted By Ray Sun
I want to retrieve files whose names have at...
I want to retrieve files whose names have at least two characters but do not start with 'AB'. The command : ls [!A][!B]* just list files that do not start with 'AB', thus, file AC will not appear in...
1,617
Posted By Ray Sun
Globbling with multiple criteria (UNIX Shell)
I am new to UNIX Shell. I want to list the files names in the current directory that are not start with 'AB' and have at least two characters. For example, say I have those files in the current...
Showing results 1 to 13 of 13

 
All times are GMT -4. The time now is 05:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy