•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 456,448 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,675 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums
Views: 936 | Replies: 1
![]() |
•
•
Join Date: Aug 2007
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
I hve code like
echo $1
echo $2
and am executing the code as ./script.sh /home/*.txt /home/*.xsd
The corresponding .txt files and .xsd files of the directory are getting substitued as the command line argument .
and it prints smething like
data.txt
value.xsd
Apart frm using * if i use anything else it works fine . But my requirement is to pass it in this format in the command line ...
Am completely new to shell scripting ....Pls Help me ...
echo $1
echo $2
and am executing the code as ./script.sh /home/*.txt /home/*.xsd
The corresponding .txt files and .xsd files of the directory are getting substitued as the command line argument .
and it prints smething like
data.txt
value.xsd
Apart frm using * if i use anything else it works fine . But my requirement is to pass it in this format in the command line ...
Am completely new to shell scripting ....Pls Help me ...
Because the shell will automatically expand those filename expansion characters before passing the arguments to the script. You might try using \* instead of *, but then, don't expect that the * will work as designed later (it may, then again it may not, I have not tried to "mask" the file expansion during initialisation then using it later).
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
![]() |
•
•
•
•
•
•
•
•
DaniWeb Shell Scripting Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- command line arguments help (C)
- To fetch data through command line arguments (C++)
- HELP!!!need help with command line arguments and creating a package in java. HELP!!!! (Java)
- command line arguments (C++)
- Command Line Arguments (C#)
- Command-line Arguments. (C++)
Other Threads in the Shell Scripting Forum
- Previous Thread: Help Needed using File command in Shell scripts
- Next Thread: ssh shell script



Linear Mode