How to Change Uname output?

I want use fake uname

anyone can guide?

Make your uname and place it to current one.

One thing is that u could set an alias to the uname command, or else create your executable to call your desired uname and put it in any of your directories found in your path,after renaming the actual executable to something like uname_act.

Thx you for answer i have try to do a
shell-programming-scripting

but iam geting errors line 2: syntax error near unexpected token `('

#!/bin/sh

echo Uname (New Version)

/bin/uname.orig

Quote the string you want to echo:

echo "uname (New Version)"

Regards

Thx you for answer iam stilling geting the erros

1.sh: line 2: syntax error near unexpected token `('
'.sh: line 2: `

can you plz writ for me the programming in sh files and Attach it

:smiley:

We want to help you if you have shown that you have put some effort into solving your problem but not to do your work for you. :slight_smile:
Try single quotes instead of double quotes.

Regards

up any one can help us

Please don't bump your threads. Read the replies you have already received and try to understand them.

On Solaris you can use dtrace to temporarily change the OS version outputted
by uname(1)

(From Solaris Developer Network submission by user Rajadurai)

#!/usr/sbin/dtrace -qs
 
#pragma D option destructive
 
BEGIN
{
       printf("Changing output of uname for pid %d and its descendants...\n",$1);
}
 
syscall::uname:entry
/progenyof($1)/
{
       self->addr = arg0;
}
 
syscall::uname:return
/progenyof($1)/
{
       copyoutstr("5.9", self->addr+(257*2), 257);
}