- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Shell problem
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
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
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
04-02-2002 10:59 AM
04-02-2002 10:59 AM
Shell problem
I have a file named ss
ss:
consulting
Global Exotica - DEVADM
Global Exotica - DEVSTD
NSD
My question:
for dirname in `cat ss`
do
echo "$dirname"
mkdir "$dirname"
done
I cannot get the dirname "Global Exotica - DEVADM" and Global Exotica - DEVSTD" because of the space
Hope I can get feedback
very appreciated advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2002 11:04 AM
04-02-2002 11:04 AM
Re: Shell problem
# sed 's/ //g' ss > ss.new
The "ss.new" file would then looked like ..
consulting
GlobalExotica-DEVADM
GlobalExotica-DEVSTD
NSD
Now run it through the for loop.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2002 11:06 AM
04-02-2002 11:06 AM
Re: Shell problem
# mkdir "this is stupid"
# ls -l | grep this
drwxrwxrwx 2 root sys 96 Apr 2 14:05 this is stupid
#
put filename in QUOTES
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2002 11:07 AM
04-02-2002 11:07 AM
Re: Shell problem
You can change all space by a _.
cat ss | sed s/" "/_/g >! ss.new
Frank.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2002 11:10 AM
04-02-2002 11:10 AM
Re: Shell problem
OLD_FS=$FS
FS=`echo "\n"`
for...
...
done
FS=$OLD_FS
HTH
mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2002 11:10 AM
04-02-2002 11:10 AM
Re: Shell problem
for dirname in `cat ss`
do
echo "$dirname"
mkdir "${dirname}"
done
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2002 11:32 AM
04-02-2002 11:32 AM
Re: Shell problem
while read dirname
do
echo $dirname
mkdir "$dirname"
done
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2002 11:39 AM
04-02-2002 11:39 AM
Re: Shell problem
Thanks a lot
my question is I can't get dirname from ss
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2002 11:51 AM
04-02-2002 11:51 AM
Re: Shell problem
Try this
ss:
"consulting "
"Global Exotica - DEVADM "
"Global Exotica - DEVSTD "
"NSD "
Add "" in file ss and then
#cat ss |xargs mkdir
Thanks
Prashant.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2002 11:56 AM
04-02-2002 11:56 AM
Re: Shell problem
cat ss | while read line;
do
echo $line
mkdir ${line}
done
Sachin Patel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2002 11:59 AM
04-02-2002 11:59 AM
Re: Shell problem
Did you try the "while read dirname" loop? For each line of ss, $dirname will contain the entire line, spaces and all and it will create the directories with names like "Global Exotica - DEVADM".
Darrell