- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: C-shell script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2003 11:14 PM
08-17-2003 11:14 PM
I want to write an interactive line in a C-shell script which asks the operator if he/she wants to continue - something like :
"Do you want to continue ? [y]es/[n]o: "
set answer=($<)
when I try to test answer
if ($answer =~ [yY])
it returns me no match - I have tried also with [Y][y] and also with == operator,
where am I wrong? I must wite it in csh - this is the used shell for this user.
Thank you,
ionut
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2003 11:29 PM
08-17-2003 11:29 PM
Re: C-shell script
echo "Do you want to continue ? [y]es/[n]o: \c"
read ans
echo $ans
ans=input from user
regards
mB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2003 11:39 PM
08-17-2003 11:39 PM
Re: C-shell script
just for test,
what is the content of $answer?
Try visualizing it with a
set -x
at the beginning of the script. Honestly i do not know what the sintax " $< " means...
Maybe using a
read answer
will do the trick.
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2003 11:45 PM
08-17-2003 11:45 PM
Re: C-shell script
this syntax set a=($<) is proposed in "Shells: User's guide" book from HP for interactive shell-scripts for c-shell.
just for test: when I type y as answer it returns me:
y =~[Yy] no match
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2003 12:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2003 12:33 AM
08-18-2003 12:33 AM
Re: C-shell script
case closed