General :: Creating A Shell Using C Which Could Implement LS Command

Sep 4, 2010

I would like to create the shell which would support the LS command in C++. And the way the command prompt can be changed.

View 7 Replies


ADVERTISEMENT

Programming :: Creating Array From Command Output (Bash Shell Script)

Jan 26, 2011

I have a command that outputs n lines of text, and I want to place each line into an array element, but I can't seem to get the syntax correct

So my command is this:
cat $configfile | sed -n '/cluster:'$clustername'/,/cluster/ p' | awk /host/

Which produces many lines depending on the value of $clustername. I'd like to get each line as elements of an array.

View 5 Replies View Related

General :: How To Implement LS Command In C

Feb 16, 2010

Is there any function like mkdir() or link() for command ls? If not, how is ls implemented?

View 4 Replies View Related

General :: Creating Tar : Shell Vs Ui, Size Differs?

Oct 14, 2010

In a shell script, I am creating a .tar using this command

Code:
tar -zcvf dst/lib/library.tar.gz dst/lib
There are two problems:

[code]...

View 1 Replies View Related

Programming :: Implement (linear Data Structure) Queue In Shell Script?

Jun 21, 2010

I am in deeply need of queue (linear data structure) in shell script. How can I implement this ??

View 2 Replies View Related

General :: Source Code Or The Procedure For Creating Own Shell?

Nov 3, 2010

i need the source code to create my own shell in linux or provide atleast procedure for doing it

View 9 Replies View Related

General :: Creating A Terminal Command From Scratch?

Oct 26, 2010

I am looking into creating my own terminal command from scratch. I researched online for some information on this subject was only able to view stuff related to OS X. I understand that they are both Unix based, are they both similar in creating these commands? Basically all I would like is for someone to point me towards the right direction to start or complete this task.

View 11 Replies View Related

General :: Creating Account With Useradd Command

Mar 9, 2011

I encountered a question in the Redhat Skills Assessment regarding useradd: Which of the following cannot be defined when you create a user account with useradd?
a* A password expiration date.
b* The user's primary group.
c* The user's default shell.
d* The user's NIS or LDAP group.
e* The user's home directory.
Which is the correct answer? I have my own thinking which will be explained later.

View 2 Replies View Related

General :: Dd Command Not Working While Creating Live USB

Feb 5, 2011

I want to create a Live USB ..I have the ISO image in the hard disk

Where Sdb is my USB

The copy operation is okay...It says no of records in / out and gives the statistics

But when I boot the system , getting the error:

Boot :

In some cases , the USB itself is not recognized by BIOS at boot..

My BIOS supports boot from USB ..I have Boot order 1. CD/DVD 2. USB 3. HDD

Also what is the filesystem to be adopted for dd?

I usually format using FAT or FAT 32

1.mkfs.vfat /dev/sdb -I (or)
2.mkdosfs /dev/sdb (or)
3.mkdosfs -F 32 /dev/sdb

What is the correct way of partitioning USB drive? - FAT or FAT 32....Most Live USB creators (unetbootin/LiLi Live/Usb Creator) recognize only FAT32...

I dont want a Linux filesystem (ext2,ext3 or 4or reiserfs)for my USB as it is not portable across many systems as MS OSes do not read them..Also I had little success in booting a USB when I partitioned it using ext2..I read somewhere that ext2 will not reduce the life of the USB drive compared to other fs.

View 3 Replies View Related

General :: Creating User With Password In Single Command?

Jan 16, 2010

I'm trying to create a user john with default password 'abcdef'. I used the following command.

useradd john -p abcdef

I can't login with the password. in /etc/shadow file I can see the password in clear text format. how I can create a user along with password.

View 3 Replies View Related

General :: Batch User Creating With 'newusers' Command Question

Jul 26, 2011

I recently used the newusers command to generate several user accounts from a text file. That process seemed to go well until I tried to su into one of the new accounts.

This behavior appears for all the accounts that were created from the text file and the newusers command. It seems that several configuration files that should have been autogenerated for these new users were never created. I was able to confirm this was the problem by copying .bashrc and .bash_profile from a user that was created with the "useradd" command into the /home/newaccount directory. After logging off and logging into the newaccount again, the issue is corrected.For the record, I just read this forum post and I'm looking for an alternative to this. If this is the most efficient way to accomplish my goal, then I'll try the route mentioned in the thread. I'm still open to alternatives.

View 1 Replies View Related

General :: Run A Shell Command With &?

Jun 15, 2010

I am using Red Hat Linux Enterprise version 5. I've noticed people sometimes running commands with a couple of & options. For example, in the below command, there are two & signs. What is the purpose of them? Are they always used together with nohup?

nohup foo.sh <script parameters> >& <log_file_name> &

View 6 Replies View Related

General :: Command Line - Create Directories That Don't Exist While Creating A New File?

May 8, 2010

I can do:mkdir messages and then: touch messages/hello.txt Is there a command that will do both - create the directory if it doesn't exist, and then the empty file? Something like: touch -p messages/hello.txt

View 1 Replies View Related

General :: Looking For System Shell Command?

May 31, 2011

I'm looking for a specific command,if it exist... i want to login from my server to another Linux server,but the question is: can i do it in a one line command for ex:
usually you type: ssh "user"@10.1.1.1 and then the password,but I'm looking for a command in one line a fake ex: ssh user@10.1.1.1 -p "password" something like that.
I don't know if anyone of you understand what do i want to say .

View 6 Replies View Related

General :: Shell Command To Let System Box Go Sleep?

Jun 21, 2010

I'm writing a shell script to check the I/O activity of a Linux box and if the server is quiet for a certain long time, the script should let the server go to sleep. But, after some Google searching, I didn't find a answer yet. Is there a shell script command to put a Linux box to sleep?

View 3 Replies View Related

General :: Executing A Shell Command In Emacs?

Dec 17, 2010

I tried to execute a shell command by M-! cmd RET but it did not work.M-! does not turn up in the microbuffer no matter how many times I press Alt+!.But if I go to Tools menu and select Shell Command... option then it writes M-! to the microbuffer and everything works fine.What is the problem here?

View 2 Replies View Related

General :: Triming Lines Using Shell Command?

Mar 22, 2011

i have a text file generated automatically from a script , but the result in the script is not ordered in a readable way, so i need your help to fix it using a shell command the text file contain data in this way :

Code:

0.147361 0.243688 0.081520 -0.446603 1.130529 NC_000846 Chordata
Rheiformes
Aves
0.091740 0.379224 0.021160 -0.088493 3.441356 NC_000857 Arthropoda
Diptera

[code]....

i want to arrange the data in this text file in a way that each line will concatenate the 2 lines after it , so that will be 1 line , i want all the lines to be treated in this way ,

View 2 Replies View Related

General :: Backslash Preceding A Shell Command

Mar 21, 2011

Reading a BASH script, I saw a find command preceded with a backslash. It was similar to this:

Code:
`find . -type f -name '*.xml' -print > xmlfilelist`

It's impossible to find documentation about this in man pages or on the internet, since 'backslash' are always evoked along with special characters. I also noticed that even though the command was surrounded with backquotes, the result was not affected to any variable. Maybe the backslash's presence is related with this?

View 2 Replies View Related

General :: Create The Shell Which Would Support The LS Command In C++?

Sep 4, 2010

I would like to create the shell which would support the LS command in C++. And any way to change the command prompt.

View 1 Replies View Related

General :: Shell Command To Display Contents Of A File?

Feb 23, 2010

shell command to display contents of a file? Like that of .txt or .html

View 9 Replies View Related

General :: Pipe Output Of Shell Command Into A New Buffer In Vim?

Jun 29, 2010

How can I pipe the output of a shell command into a new buffer in Vim? The following obviously wouldn't work, but you can see what I'm getting at:

:!echo % | :newtab

View 2 Replies View Related

General :: Make A Shell - Using Mail Command DestMail= Cat

Jul 22, 2011

I have a problem to make a shell, using mail command DestMail= cat /opt/scripts/maillist.txt mail -s"SUBJECT" $DestMail -- -r xxxxx@gmail.com < /opt/scripts/test.txt where: maillist.txt contain email adresse separated by comma test.txt mail text this script can eval DestMail variable!!

View 1 Replies View Related

General :: Want Shell Command Amount Space In Disk For Mp3

Jun 25, 2010

We use a SLES 10 SP2 file server. This file server has all type of files. We want to know what is the amount of space used by mp3 files. What we need to know is the total space in disk of mp3 files. I've been testing du command, and find command, but with no satisfactory results. Does anybody know how to do this?

View 11 Replies View Related

General :: 'cd' Command Increases Size Of Shell Propmt?

Sep 10, 2010

When i change the directory using 'cd', the length of my shell prompt keeps on increasing. To make it more clear kindly see below

Code:
$> cd MyWorks
$ Myworks> cd Shell

[code]....

View 8 Replies View Related

General :: Clear Screen Command For BASH Shell

Jan 21, 2010

I am unable to use clear or cls command on bash shell. I have recently installed Cygwin and am using that for practicing unix commands.

I see that I can use Ctrl + L to clear the screen. I created an alias in my .bashrc to do the same as
alias cls='^L'

This is how i defined other aliases e.g.

And they work. Hence I assume cls will work too but this is what I get when I try to give cls on command prompt. Am i missing something? Is there a way to do this?

Then someone suggested, You cannot alias keystrokes to commands or vice versa. You could just alias cls to an echo command: echo -en "x0c"

And I added the following to .bashrc,

Sourced the .bashrc file. No errors but cls still does not clear the screen. Infact when I typed the echo -en "x0c on command prompt as well, nothing happened. What does this command do?

View 3 Replies View Related

General :: Use Ssh And Run Command In The Remote Machine Using Shell Script?

Apr 27, 2011

How can i do that.. Today is my first day writing a script.. and correct me if this Thread should be somewhere else..

Code:

if [ $1=$anyvariable ]; then
ssh www.a.com <Have to set few variables and give commands >

View 8 Replies View Related

General :: How To Visit URL Using Shell Script Or Unix Command

Aug 2, 2011

I want to visit a url but this shall be invoked by a shell script. Anyone let me know the command to hit a url in unix.

View 5 Replies View Related

General :: Building Application In Shell Using Make Command

May 26, 2011

Consider that I am building my application in Linux shell using make command but somehow the build fails. Is there any way I can find out that the build has failed (of course looking at shell for error messages will do the job for me but I don't want that). Is there any flag make or shell will set/reset if such failure occurs ?

View 5 Replies View Related

Debian :: Creating A Bash-shell Script

Dec 1, 2015

how to do in Debian

1. am required to create a bash-shell script called terminator that terminates all processes of a name given to the shell script as an argument. Make sure the terminator shell script will not take any crucial file system services as arguments.

2. Show how you would configure an Ethernet card by reapplying your existing IP and network mask

3. Install a workable nfs file sharing system between your system and a remote system, using optimum values for resize and wsize.To demonstrate send a 512Mb block of random data between client and server using the dd command.Write down the relevant steps and procedures

View 6 Replies View Related

Software :: Shell Script For Creating Report?

Aug 31, 2010

`cat /var/log/secure | grep "refused connect" |awk '{print $9}'|sed 's/::ffff://g'|uniq -c | sort -nr |head -2 | awk '{print $2}' >/root/sample`
for IP in `cat /root/sample`;

[code]...

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved