- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Script needed
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
11-28-2006 06:48 AM
11-28-2006 06:48 AM
The command which I use to get the version history is called "sccs prs filename"
Here is the example , it lists the latest version on the top and then then subsequent version below. I only need the latest version and the filename from the script and put it into an excel sheet for records.
-------------------------------------
$ sccs prs filename
filename
D 1.20 06/11/27 12:23:34 userid1 25 24 00012/00012/01066
MRs:
COMMENTS:
xxxx
D 1.19 06/10/12 08:21:45 userid1 24 23 00006/00006/01072
MRs:
COMMENTS:
xxx
D 1.18 06/10/06 09:33:49 userid1 23 22 00004/00004/01074
MRs:
COMMENTS:
xxxx
Solved! Go to Solution.
- Tags:
- SCCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 07:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 07:27 AM
11-28-2006 07:27 AM
Re: Script needed
$ sccs prs filename | awk '
BEGIN {
getline
filename = $0
getline; getline
VER = $2
print filename "," VER
exit 0
} '
For your above input, it prints:
filename,1.20
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 07:48 AM
11-28-2006 07:48 AM
Re: Script needed
Thanks,
hunki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 07:56 AM
11-28-2006 07:56 AM
Re: Script needed
#!/usr/bin/sh
for file in $(ls /path/to/dir)
do
sccs prs ${file} | awk -f prog.awk
done
exit
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 08:05 AM
11-28-2006 08:05 AM
Re: Script needed
awk: can't open prog.awk
ERROR [SCCS/s.$(ls]: `SCCS/s.$(ls' nonexistent (ut4)
ERROR [/appl/solid/develop/SCCS/s.2006.3)]: `/appl/solid/develop/SCCS/s.2006.3)' nonexistent (ut4)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 08:06 AM
11-28-2006 08:06 AM
Re: Script needed
awk: can't open prog.awk
ERROR [SCCS/s.$(ls]: `SCCS/s.$(ls' nonexistent (ut4)
ERROR [/xx/xx/xx/s.2006.3)]: `/xx/xx/s.2006.3)' nonexistent (ut4)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 08:10 AM
11-28-2006 08:10 AM
Re: Script needed
for i in $(ls -1
do
sccs prs $i | awk '!/^$/{if(x){x=x" "$2;print x;exit}else x=$0}'
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 08:11 AM
11-28-2006 08:11 AM
Re: Script needed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 08:23 AM
11-28-2006 08:23 AM
Re: Script needed
awk: can't open prog.awk
I assume Spex was pointing to my example awk script. Just put my fragment (without the trailing "'" in prog.awk.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 08:28 AM
11-28-2006 08:28 AM
Re: Script needed
I ran it again Dennis but this is what I got :(
./check_version: syntax error at line 2: `$' unexpected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 09:25 AM
11-28-2006 09:25 AM
Re: Script needed
do you work under HP-UX?
If not,
#!/usr/bin/sh
may not start a posix shell. Use
#!/usr/bin/ksh
instead.
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 10:57 AM
11-28-2006 10:57 AM
Re: Script needed
>for file in $(ls /path/to/dir)
This is valid ksh or posix shell syntax and replaces the archaic ``. But it can be simplified to:
for file in path/to/dir/*; do
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2006 07:17 PM
11-28-2006 07:17 PM
Re: Script needed
combining the pieces of code:
#!/usr/bin/sh
for file in `ls`
do
sccs prs $file | awk '
BEGIN {
getline
filename = $0
getline; getline
VER = $2
print filename "," VER
exit 0
}'
done
Please generate a shell script (a.sh) with the above. Then "chmod 744 a.sh". To run it "./a.sh"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2006 06:27 AM
11-29-2006 06:27 AM
Re: Script needed
parent dir : /appl/XXX/XXX/cur .... and there are subdirectories under it which need to be looked into.
Thanks,
hunki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2006 09:15 AM
11-29-2006 09:15 AM
Re: Script needed
just change the way the filenames in question are determined:
Change
for file in `ls`
do
...
to something like this:
find YOUR_DIRNAMES -name SCCS -prune -type f -print | while read file
do
...
mfG Peter
PS: Your assignment rate for points is worth to rise...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2006 09:51 AM
11-29-2006 09:51 AM