Programming :: Cut Command Wont Work?
Mar 3, 2010on linux command promt cut command work.but the same command gives empty output in linus shell?F1=$(echo $line | cut -s -f26) NOT working in shellcat file | cut -s -f26 work!
View 3 Replieson linux command promt cut command work.but the same command gives empty output in linus shell?F1=$(echo $line | cut -s -f26) NOT working in shellcat file | cut -s -f26 work!
View 3 RepliesI have a script that will build a list of hosts and it works fine Code: for ((i=$START; i<=$END; i++)); do echo "$NAME$i"; done But I need it to build the START and END on different number formats (i.e. 1 -> 10, 01->10, 001 ->010)
I am trying to use the seq command but can't get it to work quite right with the -w flag in the following Code: for ((myseq=$START; myseq<=$END; myseq ++)) do echo "$NAME${myseq}" done I am fully aware that this syntax is probably wrong, and need to know how to correct it.
Writing script to create backup of file by adding datetime to file name. Basically test for file presence if there, cp with datetime then rm original cp works fine from command line but get cannot stat `full path to file': No such file or directory
Code:
Here are the errors: cp: cannot stat `~/html/CVP_dadamail/.dada_files/.logs/errors.txt': No such file or directory rm: cannot remove `...': No such file or directory
The for statement is a placeholder as I have same file to backup out of several directories. using "bash -x scriptname" -OR- inserting echos, I can see I've constructed the strings properly. Believing it might be related to the hidden directories, I tried setting the shopt "glob" options to no avail.
Ultimately I'll add the other directories to the for loop and then run this from a cron job, so if you see potential pitfalls knowing I'm headed in that direction...believe construct would be
Code:
Code: cmd='date | wc'
$cmd If this script is executed, an error is generated. The reason written was that "The execution fails because the pipe is not expanded and is passed to date as an argument".What is meant by expansion of pipe. When we execute date | wc on the command line, it goes fine.then | is not treated as an argument. Why?
I am trying to learn how to pass more than a one-command startup for gnome-terminal.
I will give an example of what I'm trying to do here:
Code:
#! /bin/bash
#
#TODO write this for gnome and xterm
USAGE="
${0##*/} [-x] [-g]
code....
However, running with the -g option to invoke gnome-terminal, I get a "There was an error creating the child process for this terminal" error.
This same error occurs if the gnome-terminal line is changed to
Code:
gnome-terminal -e mcTerm
Is there any way to pass more than one command on to gnome-terminal? I have tried various single and double quoting senarios and in a final attempt, I abstracted to an exported function all to no avail. Perhaps even though gnome-term is better at many things than xterm, xterm trumps it in this instance.
I am writing a perl script which uses the matlab compiler to compile a .m file.
I am using the system("mcc �m file.m"). I have matlab installed and both script and exe are in the same drive.But i get the following error .
'mcc' is not a recognised as an internal or external command ,operable in program or batch file.
I am using gtk to program GUI. How can I show the output of shell command into a textbox, ex ps -efc command ?
View 3 Replies View RelatedI'm trying to convert this awk command from command line into an awk script, but just cannot get it to work:
This is what i have after my BEGIN
Am i missing something here? this just prints out the count for everyline, not counting lines on 5th field that match 'A'
suppose i store the history number of a command say :
1004 cat file
Then now i want to run it like : !1004 but by using a variable.
command=1004
!$command
i am getting errors like :
command=1004command
I am trying to grep multiple numbers from file, grep does have the -f option for that.
Code: grep -f <`seq 500 520` /etc/passwd I know this could be done with
Code: for i in `seq 500 520`; do grep "$i" /etc/passwd; done But my question is fare more behind this example. It is possible to redirect one command output which will be treat as a content of file for another command ?
Picasa Web Albums - Sri - Linux
when i hit alt+F2 the run dialogue opens up but i am unable to type anything there.you can see the screenshots of those in that link.any packages to reinstall??
i am using kde 4.3.1 (KDE 4.3.1) "release 6" on opensuse11.2 64 bit.i have used this before with no problem.i recently formated my system and i am getting this since then
I just logged in to my remote shell account like I always do: as an ordinary user, because root login is disabled in sshd. Then I may want to become root with the 'su -' command.
But the 'su -' command did not work today. Every time I tried, I got this laconic message: "Sorry."
Note that I wasn't even given a chance to enter the password. Just 'su -', Return, "Sorry."
I logged in to the service host control panel and rebooted the system. I can su - and be root again.
Fine, but... What happened?!! I searched Google and only found reports of people who at least were given the chance to enter the password.
Yum command does not work, I tried to install apache2, mysql-server, php5 and gave the following error:
Code:
yum: line 1: fg: no job control
yum: line 2: syntax error near unexpected token `ImageMagick'
yum: line 2: `%%Creator: (ImageMagick)'
I used SVN to check out the code of an open source project. When I typed the following command:
[user1@smallfox]~/workspace/project1% svn co http://svn.apache.org/repos/asf/mahout/trunk
It worked just fine. However, when I typed the SVN command in the root directory, it did not work and gave me an error message:
[user1@smallfox]~% svn co http://svn.apache.org/repos/asf/mahout/trunk
zsh: command not found: svn
My beep command stopped working -- it does not beep. I think this happened when I upgraded to Karmic (but could have been earlier). I use the beep command to notify me of important events.
I tried looking in sound settings, and did not find anything suspicious. I also tried googling but most stuff just describes how to "disable the annoying beep". Lastly, I tried different software channels and repositories to find an alternative program to the beep command, but nothing happened.
I use the 10.04 ubuntu, somehow I did something and now the apt-get install command doesn't work. No matter what package I try to download, there's always a "couldn't download all packages run update or --fix...." message. When I scroll up I see that it downloaded some packages but it couldn't find them all. So I thought that I should try a different server. I googled it and found that the server's address is stored in /etc/apt/sources.list. I edited that file and replaced all the deb and deb-src lines with the server's address. I saved that but when I tried to download something (like vlc) I got a "E: Couldn't find package vlc" message. I also tried many different server's but there was no difference. Am I doing it wrong? Should I run a command after editing the /etc/apt/sources. list file? Or didn't I edited the file right?
View 4 Replies View RelatedI was attempting to install the fglrx driver on my new ubuntu insallation, following a guide I found from google. At one point it says I need to login as super user, so I tried and no matter how many times I try it just keeps saying authentication failed. I even tried typing in my password with 1 finger, multiple times, every single time, authentication failed. So I decided to try the sudo command with fdisk -l, worked flawlessly. Tried the su command again, authentication failed, I have no idea what in heck is causing this but it just won't stop happening.
View 1 Replies View RelatedI don't know why --exclude doesn't work when I use tar command. Please see this code
Code:
mahmood@pc:~$ l a/
1.txt 2.txt 3.txt b/
mahmood@pc:~$ tar cvjf compressed.tar.bz2 --exclude=/home/mahmood/a/b/ a/
a/
a/2.txt
a/1.txt
a/3.txt
a/b/
mahmood@pc:~$
As you can see although I excluded b/ but tar command ignored that.
I'm running this command, and seems not to work, following the command:Quote:for nic in `ls /sys/class/net | grep -v lo`; do echo ${nic}; udevinfo -a -p /class/net/{nic} | grep -i address; doneThe output is the following:Quote:eth0eth1But the output should show something like this: (showing the MAC address)uote:
I am have trouble getting the ls command to work exactly how I want, for example, sometimes I want to list the contents of a directory into a text file by command:
Code:
ls directory > list.txt
(assume the only objects the directory contains are files with extension .dat eg file1.dat, file2.dat, ...)sometimes I want the relative path of the files prepended to them in my text file eg:
path/file1.dat
path/file2.dat
path/file3.dat
[Code].....
It feels like ls is unpredictable in this regard - sometimes it prepends the path and sometimes it doesn't and sometimes it adds both entries (with and without the path prepended into the text file)....How can better control the way ls works?
I use lenny but when I use the example
time -f "%E real,%U user,%S sys" ls -Fs
-bash: -f: command not found
real 0m0.002s
user 0m0.000s
sys 0m0.000s
Is this a bug or what is wrong use the example from "man time"
have You noticed that mt command doesn´t work anymore on 11.4? We try to install new version to hadle robotic library, but someone has written mt command as a new, and it doesn´t accept mt -f command anymore. cpio based mt command it´s not reliable as old one. Can anyone tell where to get old mt command which is compatrible new 11.4 x64 bit version?
View 9 Replies View RelatedI accidentally removed gnome-desktop when I removed PuleAudio. When I boot, I log in and I am stuck at the CLI. However, I can't get any command to install Gnome to work, including sudo apt-get install gnome-desktop or sudo apt-get install gnome. I forget what the error messages were.
View 1 Replies View Relatedcd /Desktop/ ??
I can change to just about any dir of my file system with cd /filename/
eg cd /var/ or cd /opt/
it will skip me up or down the tree to get there but when if go cd /Desktop/or cd /myuseraccount/
is get: bash: cd: /Desktop/: No such file or directory
i have to be right next to the directory to get there.i dont get it. why is this?
Basically, I'm in the terminal and I type in:cd desktop (or downloads or whatever)and nothing happens. I'm probably just being legendarily thick, but where am I going wrong?
View 9 Replies View RelatedI am teaching using an Ubuntu 10 server. The course stipulates the students use the mail command to send me assessment work, however I can't get mail to work (I did have to install it in the first place). After I end the message with a dot I get the message "send-mail: cannot open mail:25".
View 7 Replies View Related-cd command of urxvt doesn't work
View 1 Replies View RelatedCode:
nnjond@nnjond-den:/$ cd /media/disk/Dual_Data/
nnjond@nnjond-den:/media/disk/Dual_Data$ ls
07_Magna_DOWNLOADS 21_TEMPS Peleas.htm
08_Self-Improvement 22_Desktop Pelleas.odt
[code]....
i am using rhel 5.4..today i type the command setup! is not workERRor: error while loading shared libraries: libslang.so.2: cannot open shared object file: No such file or directory
View 5 Replies View RelatedI want to install some software using sudo apt-get command,but it dosen't work.(my network works well) how to handle it? below is the output of terminal:
@ubuntu:~/Downloads$ sudo apt-get install build-essential cdbs fakeroot dh-make debhelper debconf libstdc++6 dkms libqtgui4
Reading package lists... Done
Building dependency tree
[Code].....