HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- circumstances in which relative path impact shell ...
Operating System - Linux
1827791
Members
2719
Online
109969
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
06-13-2010 08:51 PM
06-13-2010 08:51 PM
circumstances in which relative path impact shell script
Hi Guru,
Ive written a script, but it seems sometime(not known) could not working. From console log i relaised it is sometimg relative path is impacting..also i never relaised this problem in develpoment phase. Here is code snippet.
=========
for z in `seq $NO_PAYLOADS`; do
FROM_PAYLOAD=${PAYLOD_IPADDR[$[z-1]]}
mkdir -p /var/log/payload_syslogs
cd /var/log/payload_syslogs
mkdir -p payload_$z
cd payload_$z
echo "Collecting syslog,dmesg,fund_com_log from $FROM_PAYLOAD"
/etc/ncs/ncs_collect_payload_syslog $FROM_PAYLOAD >>$COLLECT_LOG 2>&1
cd ../
SLOT_NO=`cat payload_$z/node_id` #problem happen here
mv payload_$z payload_$SLOT_NO
tar zcvmf payload_$SLOT_NO.tgz payload_$SLOT_NO
rm -rf payload_$SLOT_NO
done
==========
Could you please let me know in which circumstances this relative path (as well cd ../) would not work?
BR/MKS
Note: Attched is console error print.
Ive written a script, but it seems sometime(not known) could not working. From console log i relaised it is sometimg relative path is impacting..also i never relaised this problem in develpoment phase. Here is code snippet.
=========
for z in `seq $NO_PAYLOADS`; do
FROM_PAYLOAD=${PAYLOD_IPADDR[$[z-1]]}
mkdir -p /var/log/payload_syslogs
cd /var/log/payload_syslogs
mkdir -p payload_$z
cd payload_$z
echo "Collecting syslog,dmesg,fund_com_log from $FROM_PAYLOAD"
/etc/ncs/ncs_collect_payload_syslog $FROM_PAYLOAD >>$COLLECT_LOG 2>&1
cd ../
SLOT_NO=`cat payload_$z/node_id` #problem happen here
mv payload_$z payload_$SLOT_NO
tar zcvmf payload_$SLOT_NO.tgz payload_$SLOT_NO
rm -rf payload_$SLOT_NO
done
==========
Could you please let me know in which circumstances this relative path (as well cd ../) would not work?
BR/MKS
Note: Attched is console error print.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2010 03:47 AM
06-14-2010 03:47 AM
Re: circumstances in which relative path impact shell script
The use of relative paths and "cd ../" looks OK to me.
The error message says pretty clearly that the file "/var/log/payload_syslogs/payload_1/node_id" does not exist.
Because your script creates the payload_1 sub-directory, the node_id file cannot pre-exist. Should the /etc/ncs/ncs_collect_payload_syslog command create that file? *Does* it create the file in fact?
Your script redirects the error messages of the ncs_collect_payload_syslog command to the file named by the variable $COLLECT_LOG. What's in that file? Any informative error messages?
MK
The error message says pretty clearly that the file "/var/log/payload_syslogs/payload_1/node_id" does not exist.
Because your script creates the payload_1 sub-directory, the node_id file cannot pre-exist. Should the /etc/ncs/ncs_collect_payload_syslog command create that file? *Does* it create the file in fact?
Your script redirects the error messages of the ncs_collect_payload_syslog command to the file named by the variable $COLLECT_LOG. What's in that file? Any informative error messages?
MK
MK
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP